home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 November: Tool Chest / Dev.CD Nov 00 TC Disk 1.toast / Sample Code / Files / Standard File / StandardGetFolder / MoreFilesExtras.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-09-28  |  113.5 KB  |  3,138 lines  |  [TEXT/CWIE]

  1. /*
  2.     File:        MoreFilesExtras.h
  3.     
  4.     Description:A collection of useful high-level File Manager routines.
  5.  
  6.     Author:        JL
  7.  
  8.     Copyright:     Copyright: © 1992-1999 by Apple Computer, Inc.
  9.                 all rights reserved.
  10.     
  11.     Disclaimer:    You may incorporate this sample code into your applications without
  12.                 restriction, though the sample code has been provided "AS IS" and the
  13.                 responsibility for its operation is 100% yours.  However, what you are
  14.                 not permitted to do is to redistribute the source as "DSC Sample Code"
  15.                 after having made changes. If you're going to re-distribute the source,
  16.                 we require that you make it clear in the source that the code was
  17.                 descended from Apple Sample Code, but that you've made changes.
  18.     
  19.     Change History (most recent first):
  20.                 6/25/99    Updated for Metrowerks Codewarror Pro 2.1(KG)
  21.  
  22. */
  23. #ifndef __MOREFILESEXTRAS__
  24. #define __MOREFILESEXTRAS__
  25.  
  26. #include <Types.h>
  27. #include <Files.h>
  28.  
  29. #include "Optimization.h"
  30.  
  31. #ifdef __cplusplus
  32. extern "C" {
  33. #endif
  34.  
  35. /*****************************************************************************/
  36.  
  37. /* Constants and types from Universal Interfaces 3.0.1 Files.h */
  38.  
  39. #if    UNIVERSAL_INTERFACES_VERSION < 0x0301
  40.  
  41. enum {
  42.     volMountNoLoginMsgFlagBit    = 0,                            /* Input to VolumeMount: If set, the file system */
  43.     volMountNoLoginMsgFlagMask    = 0x0001,                        /*  should suppresss any log-in message/greeting dialog */
  44.     volMountExtendedFlagsBit    = 7,                            /* Input to VolumeMount: If set, the mount info is a */
  45.     volMountExtendedFlagsMask    = 0x0080                        /*  AFPXVolMountInfo record for 3.7 AppleShare Client */
  46. };
  47.  
  48. /* AFPXVolMountInfo is the new AFP volume mount info record, requires the 3.7 AppleShare Client */
  49.  
  50. struct AFPXVolMountInfo {
  51.     short                             length;                        /* length of location data (including self) */
  52.     VolumeType                         media;                        /* type of media */
  53.     short                             flags;                        /* bits for no messages, no reconnect */
  54.     SInt8                             nbpInterval;                /* NBP Interval parameter (IM2, p.322) */
  55.     SInt8                             nbpCount;                    /* NBP Interval parameter (IM2, p.322) */
  56.     short                             uamType;                    /* User Authentication Method type */
  57.     short                             zoneNameOffset;                /* short positive offset from start of struct to Zone Name */
  58.     short                             serverNameOffset;            /* offset to pascal Server Name string */
  59.     short                             volNameOffset;                /* offset to pascal Volume Name string */
  60.     short                             userNameOffset;                /* offset to pascal User Name string */
  61.     short                             userPasswordOffset;            /* offset to pascal User Password string */
  62.     short                             volPasswordOffset;            /* offset to pascal Volume Password string */
  63.     short                             extendedFlags;                /* extended flags word */
  64.     short                             uamNameOffset;                /* offset to a pascal UAM name string */
  65.     short                             alternateAddressOffset;        /* offset to Alternate Addresses in tagged format */
  66.     char                             AFPData[176];                /* variable length data may follow */
  67. };
  68. typedef struct AFPXVolMountInfo            AFPXVolMountInfo;
  69. typedef AFPXVolMountInfo *                AFPXVolMountInfoPtr;
  70.  
  71. enum {
  72.     kAFPExtendedFlagsAlternateAddressMask = 1                    /*  bit in AFPXVolMountInfo.extendedFlags that means alternateAddressOffset is used*/
  73. };
  74.  
  75. enum {
  76.                                                                 /* constants for use in AFPTagData.fType field*/
  77.     kAFPTagTypeIP                = 0x01,
  78.     kAFPTagTypeIPPort            = 0x02,
  79.     kAFPTagTypeDDP                = 0x03                            /* Currently unused*/
  80. };
  81.  
  82. enum {
  83.                                                                 /* constants for use in AFPTagData.fLength field*/
  84.     kAFPTagLengthIP                = 0x06,
  85.     kAFPTagLengthIPPort            = 0x08,
  86.     kAFPTagLengthDDP            = 0x06
  87. };
  88.  
  89. struct AFPTagData {
  90.     UInt8                             fLength;                    /* length of this data tag including the fLength field */
  91.     UInt8                             fType;
  92.     UInt8                             fData[1];                    /* variable length data */
  93. };
  94. typedef struct AFPTagData                AFPTagData;
  95.  
  96. struct AFPAlternateAddress {
  97.     UInt8                             fAddressCount;
  98.     UInt8                             fAddressList[1];            /* actually variable length packed set of AFPTagData */
  99. };
  100. typedef struct AFPAlternateAddress        AFPAlternateAddress;
  101.  
  102. #endif
  103.  
  104. /*****************************************************************************/
  105.  
  106. /*
  107. **    Macros to get information out of GetVolParmsInfoBuffer
  108. */
  109.  
  110. #define    isNetworkVolume(volParms)    ((volParms).vMServerAdr != 0)
  111. #define    hasLimitFCBs(volParms)        (((volParms).vMAttrib & (1L << bLimitFCBs)) != 0)
  112. #define    hasLocalWList(volParms)        (((volParms).vMAttrib & (1L << bLocalWList)) != 0)
  113. #define    hasNoMiniFndr(volParms)        (((volParms).vMAttrib & (1L << bNoMiniFndr)) != 0)
  114. #define hasNoVNEdit(volParms)        (((volParms).vMAttrib & (1L << bNoVNEdit)) != 0)
  115. #define hasNoLclSync(volParms)        (((volParms).vMAttrib & (1L << bNoLclSync)) != 0)
  116. #define hasTrshOffLine(volParms)    (((volParms).vMAttrib & (1L << bTrshOffLine)) != 0)
  117. #define hasNoSwitchTo(volParms)        (((volParms).vMAttrib & (1L << bNoSwitchTo)) != 0)
  118. #define hasNoDeskItems(volParms)    (((volParms).vMAttrib & (1L << bNoDeskItems)) != 0)
  119. #define hasNoBootBlks(volParms)        (((volParms).vMAttrib & (1L << bNoBootBlks)) != 0)
  120. #define hasAccessCntl(volParms)        (((volParms).vMAttrib & (1L << bAccessCntl)) != 0)
  121. #define hasNoSysDir(volParms)        (((volParms).vMAttrib & (1L << bNoSysDir)) != 0)
  122. #define hasExtFSVol(volParms)        (((volParms).vMAttrib & (1L << bHasExtFSVol)) != 0)
  123. #define hasOpenDeny(volParms)        (((volParms).vMAttrib & (1L << bHasOpenDeny)) != 0)
  124. #define hasCopyFile(volParms)        (((volParms).vMAttrib & (1L << bHasCopyFile)) != 0)
  125. #define hasMoveRename(volParms)        (((volParms).vMAttrib & (1L << bHasMoveRename)) != 0)
  126. #define hasDesktopMgr(volParms)        (((volParms).vMAttrib & (1L << bHasDesktopMgr)) != 0)
  127. #define hasShortName(volParms)        (((volParms).vMAttrib & (1L << bHasShortName)) != 0)
  128. #define hasFolderLock(volParms)        (((volParms).vMAttrib & (1L << bHasFolderLock)) != 0)
  129. #define hasPersonalAccessPrivileges(volParms) \
  130.         (((volParms).vMAttrib & (1L << bHasPersonalAccessPrivileges)) != 0)
  131. #define hasUserGroupList(volParms)    (((volParms).vMAttrib & (1L << bHasUserGroupList)) != 0)
  132. #define hasCatSearch(volParms)        (((volParms).vMAttrib & (1L << bHasCatSearch)) != 0)
  133. #define hasFileIDs(volParms)        (((volParms).vMAttrib & (1L << bHasFileIDs)) != 0)
  134. #define hasBTreeMgr(volParms)        (((volParms).vMAttrib & (1L << bHasBTreeMgr)) != 0)
  135. #define hasBlankAccessPrivileges(volParms) \
  136.         (((volParms).vMAttrib & (1L << bHasBlankAccessPrivileges)) != 0)
  137.  
  138. /*****************************************************************************/
  139.  
  140.  
  141. /*
  142. **    Bit masks and macros to get common information out of ioACUser returned
  143. **    by PBGetCatInfo (remember to clear ioACUser before calling PBGetCatInfo
  144. **    since some file systems don't bother to set this field).
  145. **
  146. **    Use the GetDirAccessRestrictions or FSpGetDirAccessRestrictions
  147. **    functions to retrieve the ioACUser access restrictions byte for
  148. **    a folder.
  149. **
  150. **    Note:    The access restriction byte returned by PBGetCatInfo is the
  151. **            2's complement of the user's privileges byte returned in
  152. **            ioACAccess by PBHGetDirAccess.
  153. */
  154.  
  155. enum
  156. {
  157.     /* bits defined in ioACUser */
  158.     acUserNoSeeFoldersMask    = 0x01,
  159.     acUserNoSeeFilesMask    = 0x02,
  160.     acUserNoMakeChangesMask    = 0x04,
  161.     acUserNotOwnerMask        = 0x80,
  162.     
  163.     /* mask for just the access restriction bits */
  164.     acUserAccessMask        = 0x07,
  165.     
  166.     /* common access privilege settings */
  167.     acUserFull                = 0x00,                        /* no access restiction bits on */
  168.     acUserNone                = acUserAccessMask,            /* all access restiction bits on */
  169.     acUserDropBox            = acUserNoSeeFoldersMask + acUserNoSeeFilesMask, /* make changes, but not see files or folders */
  170.     acUserBulletinBoard        = acUserNoMakeChangesMask    /* see files and folders, but not make changes */
  171. };
  172.  
  173. /* Macros for testing ioACUser bits */
  174. #define    userIsOwner(ioACUser)    \
  175.         (((ioACUser) & acUserNotOwnerMask) == 0)
  176. #define    userHasFullAccess(ioACUser)    \
  177.         (((ioACUser) & (acUserAccessMask)) == acUserFull)
  178. #define    userHasDropBoxAccess(ioACUser)    \
  179.         (((ioACUser) & acUserAccessMask) == acUserDropBox)
  180. #define    userHasBulletinBoard(ioACUser)    \
  181.         (((ioACUser) & acUserAccessMask) == acUserBulletinBoard)
  182. #define    userHasNoAccess(ioACUser)        \
  183.         (((ioACUser) & acUserAccessMask) == acUserNone)
  184.  
  185. /*****************************************************************************/
  186.  
  187. /*
  188. **    Deny mode permissions for use with the HOpenAware, HOpenRFAware,
  189. **    FSpOpenAware, and FSpOpenRFAware functions.
  190. */
  191.  
  192. enum
  193. {
  194.     dmNone            = 0x0000,
  195.     dmNoneDenyRd    = 0x0010,
  196.     dmNoneDenyWr    = 0x0020,
  197.     dmNoneDenyRdWr    = 0x0030,
  198.     dmRd            = 0x0001,    /* Single writer, multiple readers; the readers */
  199.     dmRdDenyRd        = 0x0011,
  200.     dmRdDenyWr        = 0x0021,    /* Browsing - equivalent to fsRdPerm */
  201.     dmRdDenyRdWr    = 0x0031,
  202.     dmWr            = 0x0002,
  203.     dmWrDenyRd        = 0x0012,
  204.     dmWrDenyWr        = 0x0022,
  205.     dmWrDenyRdWr    = 0x0032,
  206.     dmRdWr            = 0x0003,    /* Shared access - equivalent to fsRdWrShPerm */
  207.     dmRdWrDenyRd    = 0x0013,
  208.     dmRdWrDenyWr    = 0x0023,    /* Single writer, multiple readers; the writer */
  209.     dmRdWrDenyRdWr    = 0x0033    /* Exclusive access - equivalent to fsRdWrPerm */
  210. };
  211.     
  212. /*****************************************************************************/
  213.  
  214. #if PRAGMA_ALIGN_SUPPORTED
  215. #pragma options align=mac68k
  216. #endif
  217.  
  218. /*
  219. **    For those times where you need to use more than one kind of File Manager parameter
  220. **    block but don't feel like wasting stack space, here's a parameter block you can reuse.
  221. */
  222.  
  223. union UniversalFMPB
  224. {
  225.     ParamBlockRec    PB;
  226.     CInfoPBRec        ciPB;
  227.     DTPBRec            dtPB;
  228.     HParamBlockRec    hPB;
  229.     CMovePBRec        cmPB;
  230.     WDPBRec            wdPB;
  231.     FCBPBRec        fcbPB;
  232.     XVolumeParam    xPB;
  233. };
  234. typedef union UniversalFMPB UniversalFMPB;
  235. typedef UniversalFMPB *UniversalFMPBPtr, **UniversalFMPBHandle;
  236.  
  237.  
  238. /*
  239. **    Used by GetUGEntries to return user or group lists
  240. */
  241.  
  242. struct UGEntry
  243. {
  244.     short    objType;    /* object type: -1 = group; 0 = user */
  245.     long    objID;        /* the user or group ID */
  246.     Str31    name;        /* the user or group name */
  247. };
  248. typedef struct UGEntry UGEntry;
  249. typedef UGEntry *UGEntryPtr, **UGEntryHandle;
  250.  
  251.  
  252. typedef unsigned char Str8[9];
  253.  
  254.  
  255. /*
  256. **    I use the following records instead of the AFPVolMountInfo and AFPXVolMountInfo structures in Files.h
  257. */
  258.  
  259. struct MyAFPVolMountInfo
  260. {
  261.     short length;                /* length of this record */
  262.     VolumeType media;            /* type of media, always AppleShareMediaType */
  263.     short flags;                /* 0 = normal mount; set bit 0 to inhibit greeting messages */
  264.     char nbpInterval;            /* NBP interval parameter; 7 is a good choice */
  265.     char nbpCount;                /* NBP count parameter; 5 is a good choice */
  266.     short uamType;                /* User Authentication Method */
  267.     short zoneNameOffset;        /* offset from start of record to zoneName */
  268.     short serverNameOffset;        /* offset from start of record to serverName */
  269.     short volNameOffset;        /* offset from start of record to volName */
  270.     short userNameOffset;        /* offset from start of record to userName */
  271.     short userPasswordOffset;    /* offset from start of record to userPassword */
  272.     short volPasswordOffset;    /* offset from start of record to volPassword */
  273.     Str32 zoneName;                /* server's AppleTalk zone name */                    
  274.     char filler1;                /* to word align volPassword */
  275.     Str32 serverName;            /* server name */                    
  276.     char filler2;                /* to word align volPassword */
  277.     Str27 volName;                /* volume name */                    
  278.     Str31 userName;                /* user name (zero length Pascal string for guest) */
  279.     Str8 userPassword;            /* user password (zero length Pascal string if no user password) */                    
  280.     char filler3;                /* to word align volPassword */
  281.     Str8 volPassword;            /* volume password (zero length Pascal string if no volume password) */                    
  282.     char filler4;                /* to end record on word boundry */
  283. };
  284. typedef struct MyAFPVolMountInfo MyAFPVolMountInfo;
  285. typedef MyAFPVolMountInfo *MyAFPVolMountInfoPtr, **MyAFPVolMountInfoHandle;
  286.  
  287. struct MyAFPXVolMountInfo
  288. {
  289.     short length;                /* length of this record */
  290.     VolumeType media;            /* type of media, always AppleShareMediaType */
  291.     short flags;                /* bits for no messages, no reconnect, etc */
  292.     char nbpInterval;            /* NBP interval parameter; 7 is a good choice */
  293.     char nbpCount;                /* NBP count parameter; 5 is a good choice */
  294.     short uamType;                /* User Authentication Method */
  295.     short zoneNameOffset;        /* offset from start of record to zoneName */
  296.     short serverNameOffset;        /* offset from start of record to serverName */
  297.     short volNameOffset;        /* offset from start of record to volName */
  298.     short userNameOffset;        /* offset from start of record to userName */
  299.     short userPasswordOffset;    /* offset from start of record to userPassword */
  300.     short volPasswordOffset;    /* offset from start of record to volPassword */
  301.     short extendedFlags;        /* extended flags word */
  302.     short uamNameOffset;        /* offset to a pascal UAM name string */
  303.     short alternateAddressOffset; /* offset to Alternate Addresses in tagged format */
  304.     Str32 zoneName;                /* server's AppleTalk zone name */                    
  305.     char filler1;                /* to word align volPassword */
  306.     Str32 serverName;            /* server name */                    
  307.     char filler2;                /* to word align volPassword */
  308.     Str27 volName;                /* volume name */                    
  309.     Str31 userName;                /* user name (zero length Pascal string for guest) */
  310.     Str8 userPassword;            /* user password (zero length Pascal string if no user password) */                    
  311.     char filler3;                /* to word align volPassword */
  312.     Str8 volPassword;            /* volume password (zero length Pascal string if no volume password) */                    
  313.     char filler4;                /* to word align uamNameOffset */
  314.     Str32 uamName;                /* UAM name */
  315.     char filler5;                /* to word align alternateAddress */
  316.     char alternateAddress[kVariableLengthArray];    /* AFPAlternateAddress */
  317. };
  318. typedef struct MyAFPXVolMountInfo MyAFPXVolMountInfo;
  319. typedef MyAFPXVolMountInfo *MyAFPXVolMountInfoPtr, **MyAFPXVolMountInfoHandle;
  320.  
  321. #if PRAGMA_ALIGN_SUPPORTED
  322. #pragma options align=reset
  323. #endif
  324.  
  325. /*****************************************************************************/
  326.  
  327. pascal    void    TruncPString(StringPtr destination,
  328.                              ConstStr255Param source,
  329.                              short maxLength);
  330. /*    ¶ International friendly string truncate routine.
  331.     The TruncPString function copies up to maxLength characters from
  332.     the source Pascal string to the destination Pascal string. TruncPString
  333.     ensures that the truncated string ends on a single-byte character, or on
  334.     the last byte of a multi-byte character.
  335.     
  336.     destination        output:    destination Pascal string.
  337.     source            input:    source Pascal string.
  338.     maxLength        output:    The maximum allowable length of the destination
  339.                             string.
  340. */
  341.  
  342. /*****************************************************************************/
  343.  
  344. pascal    Ptr    GetTempBuffer(long buffReqSize,
  345.                           long *buffActSize);
  346. /*    ¶ Allocate a temporary copy or search buffer.
  347.     The GetTempBuffer function allocates a temporary buffer for file system
  348.     operations which is at least 1024 bytes (1K) and a multiple of
  349.     1024 bytes.
  350.     
  351.     buffReqSize        input:    Size you'd like the buffer to be.
  352.     buffActSize        output:    Size of buffer allocated.
  353.     function result    output:    Pointer to memory allocated or nil if no memory
  354.                             was available. The caller is responsible for
  355.                             disposing of this buffer with DisposePtr.
  356. */
  357.  
  358. /*****************************************************************************/
  359.  
  360. pascal    OSErr    GetVolumeInfoNoName(ConstStr255Param pathname,
  361.                                     short vRefNum,
  362.                                     HParmBlkPtr pb);
  363. /*    ¶ Call PBHGetVInfoSync ignoring returned name.
  364.     GetVolumeInfoNoName uses pathname and vRefNum to call PBHGetVInfoSync
  365.     in cases where the returned volume name is not needed by the caller.
  366.     The pathname and vRefNum parameters are not touched, and the pb
  367.     parameter is initialized by PBHGetVInfoSync except that ioNamePtr in
  368.     the parameter block is always returned as NULL (since it might point
  369.     to GetVolumeInfoNoName's local variable tempPathname).
  370.  
  371.     I noticed using this code in several places, so here it is once.
  372.     This reduces the code size of MoreFiles.
  373.  
  374.     pathName    input:    Pointer to a full pathname or nil.  If you pass in a 
  375.                         partial pathname, it is ignored. A full pathname to a
  376.                         volume must end with a colon character (:).
  377.     vRefNum        input:    Volume specification (volume reference number, working
  378.                         directory number, drive number, or 0).
  379.     pb            input:    A pointer to HParamBlockRec.
  380.                 output:    The parameter block as filled in by PBHGetVInfoSync
  381.                         except that ioNamePtr will always be NULL.
  382.     
  383.     Result Codes
  384.         noErr                0        No error
  385.         nsvErr                -35        No such volume
  386.         paramErr            -50        No default volume, or pb was NULL
  387. */
  388.  
  389. /*****************************************************************************/
  390.  
  391. pascal    OSErr    XGetVolumeInfoNoName(ConstStr255Param pathname,
  392.                                     short vRefNum,
  393.                                     XVolumeParamPtr pb);
  394. /*    ¶ Call PBXGetVolInfoSync ignoring returned name.
  395.     XGetVolumeInfoNoName uses pathname and vRefNum to call PBXGetVolInfoSync
  396.     in cases where the returned volume name is not needed by the caller.
  397.     The pathname and vRefNum parameters are not touched, and the pb
  398.     parameter is initialized by PBXGetVolInfoSync except that ioNamePtr in
  399.     the parameter block is always returned as NULL (since it might point
  400.     to XGetVolumeInfoNoName's local variable tempPathname).
  401.  
  402.     pathName    input:    Pointer to a full pathname or nil.  If you pass in a 
  403.                         partial pathname, it is ignored. A full pathname to a
  404.                         volume must end with a colon character (:).
  405.     vRefNum        input:    Volume specification (volume reference number, working
  406.                         directory number, drive number, or 0).
  407.     pb            input:    A pointer to HParamBlockRec.
  408.                 output:    The parameter block as filled in by PBXGetVolInfoSync
  409.                         except that ioNamePtr will always be NULL.
  410.     
  411.     Result Codes
  412.         noErr                0        No error
  413.         nsvErr                -35        No such volume
  414.         paramErr            -50        No default volume, or pb was NULL
  415. */
  416.  
  417. /*****************************************************************************/
  418.  
  419. pascal    OSErr GetCatInfoNoName(short vRefNum,
  420.                                long dirID,
  421.                                ConstStr255Param name,
  422.                                CInfoPBPtr pb);
  423. /*    ¶ Call PBGetCatInfoSync ignoring returned name.
  424.     GetCatInfoNoName uses vRefNum, dirID and name to call PBGetCatInfoSync
  425.     in cases where the returned object is not needed by the caller.
  426.     The vRefNum, dirID and name parameters are not touched, and the pb
  427.     parameter is initialized by PBGetCatInfoSync except that ioNamePtr in
  428.     the parameter block is always returned as NULL (since it might point
  429.     to GetCatInfoNoName's local variable tempName).
  430.  
  431.     I noticed using this code in several places, so here it is once.
  432.     This reduces the code size of MoreFiles.
  433.  
  434.     vRefNum            input:    Volume specification.
  435.     dirID            input:    Directory ID.
  436.     name            input:    Pointer to object name, or nil when dirID
  437.                             specifies a directory that's the object.
  438.     pb                input:    A pointer to CInfoPBRec.
  439.                     output:    The parameter block as filled in by
  440.                             PBGetCatInfoSync except that ioNamePtr will
  441.                             always be NULL.
  442.     
  443.     Result Codes
  444.         noErr                0        No error
  445.         nsvErr                -35        No such volume
  446.         ioErr                -36        I/O error
  447.         bdNamErr            -37        Bad filename
  448.         fnfErr                -43        File not found
  449.         paramErr            -50        No default volume
  450.         dirNFErr            -120    Directory not found or incomplete pathname
  451.         afpAccessDenied        -5000    User does not have the correct access
  452.         afpObjectTypeErr    -5025    Directory not found or incomplete pathname
  453.         
  454. */
  455.  
  456. /*****************************************************************************/
  457.  
  458. pascal    OSErr    DetermineVRefNum(ConstStr255Param pathname,
  459.                                  short vRefNum,
  460.                                  short *realVRefNum);
  461. /*    ¶ Determine the real volume reference number.
  462.     The DetermineVRefNum function determines the volume reference number of
  463.     a volume from a pathname, a volume specification, or a combination
  464.     of the two.
  465.     WARNING: Volume names on the Macintosh are *not* unique -- Multiple
  466.     mounted volumes can have the same name. For this reason, the use of a
  467.     volume name or full pathname to identify a specific volume may not
  468.     produce the results you expect.  If more than one volume has the same
  469.     name and a volume name or full pathname is used, the File Manager
  470.     currently uses the first volume it finds with a matching name in the
  471.     volume queue.
  472.  
  473.     pathName    input:    Pointer to a full pathname or nil.  If you pass in a 
  474.                         partial pathname, it is ignored. A full pathname to a
  475.                         volume must end with a colon character (:).
  476.     vRefNum        input:    Volume specification (volume reference number, working
  477.                         directory number, drive number, or 0).
  478.     realVRefNum    output:    The real volume reference number.
  479.     
  480.     Result Codes
  481.         noErr                0        No error
  482.         nsvErr                -35        No such volume
  483.         paramErr            -50        No default volume
  484. */
  485.  
  486. /*****************************************************************************/
  487.  
  488. pascal    OSErr    HGetVInfo(short volReference,
  489.                           StringPtr volName,
  490.                           short *vRefNum,
  491.                           unsigned long *freeBytes,
  492.                           unsigned long *totalBytes);
  493. /*    ¶ Get information about a mounted volume.
  494.     The HGetVInfo function returns the name, volume reference number,
  495.     available space (in bytes), and total space (in bytes) for the
  496.     specified volume. You can specify the volume by providing its drive
  497.     number, volume reference number, or 0 for the default volume.
  498.     This routine is compatible with volumes up to 4 gigabytes.
  499.     
  500.     volReference    input:    The drive number, volume reference number,
  501.                             or 0 for the default volume.
  502.     volName            input:    A pointer to a buffer (minimum Str27) where
  503.                             the volume name is to be returned or must
  504.                             be nil.
  505.                     output:    The volume name.
  506.     vRefNum            output:    The volume reference number.
  507.     freeBytes        output:    The number of free bytes on the volume.
  508.                             freeBytes is an unsigned long value.
  509.     totalBytes        output:    The total number of bytes on the volume.
  510.                             totalBytes is an unsigned long value.
  511.     
  512.     Result Codes
  513.         noErr                0        No error
  514.         nsvErr                -35        No such volume
  515.         paramErr            -50        No default volume
  516.     
  517.     __________
  518.     
  519.     Also see:    XGetVInfo
  520. */
  521.  
  522. /*****************************************************************************/
  523.  
  524. pascal    OSErr    XGetVInfo(short volReference,
  525.                           StringPtr volName,
  526.                           short *vRefNum,
  527.                           UnsignedWide *freeBytes,
  528.                           UnsignedWide *totalBytes);
  529. /*    ¶ Get extended information about a mounted volume.
  530.     The XGetVInfo function returns the name, volume reference number,
  531.     available space (in bytes), and total space (in bytes) for the
  532.     specified volume. You can specify the volume by providing its drive
  533.     number, volume reference number, or 0 for the default volume.
  534.     This routine is compatible with volumes up to 2 terabytes.
  535.     
  536.     volReference    input:    The drive number, volume reference number,
  537.                             or 0 for the default volume.
  538.     volName            input:    A pointer to a buffer (minimum Str27) where
  539.                             the volume name is to be returned or must
  540.                             be nil.
  541.                     output:    The volume name.
  542.     vRefNum            output:    The volume reference number.
  543.     freeBytes        output:    The number of free bytes on the volume.
  544.                             freeBytes is an UnsignedWide value.
  545.     totalBytes        output:    The total number of bytes on the volume.
  546.                             totalBytes is an UnsignedWide value.
  547.     
  548.     Result Codes
  549.         noErr                0        No error
  550.         nsvErr                -35        No such volume
  551.         paramErr            -50        No default volume
  552.     
  553.     __________
  554.     
  555.     Also see:    HGetVInfo
  556. */
  557.  
  558. /*****************************************************************************/
  559.  
  560. pascal    OSErr    CheckVolLock(ConstStr255Param pathname,
  561.                              short vRefNum);
  562. /*    ¶ Determine if a volume is locked.
  563.     The CheckVolLock function determines if a volume is locked - either by
  564.     hardware or by software. If CheckVolLock returns noErr, then the volume
  565.     is not locked.
  566.  
  567.     pathName    input:    Pointer to a full pathname or nil.  If you pass in a 
  568.                         partial pathname, it is ignored. A full pathname to a
  569.                         volume must end with a colon character (:).
  570.     vRefNum        input:    Volume specification (volume reference number, working
  571.                         directory number, drive number, or 0).
  572.     
  573.     Result Codes
  574.         noErr                0        No error - volume not locked
  575.         nsvErr                -35        No such volume
  576.         wPrErr                -44        Volume locked by hardware
  577.         vLckdErr            -46        Volume locked by software
  578.         paramErr            -50        No default volume
  579. */
  580.  
  581. /*****************************************************************************/
  582.  
  583. pascal    OSErr GetDriverName(short driverRefNum,
  584.                             Str255 driverName);
  585. /*    ¶ Get a device driver's name.
  586.     The GetDriverName function returns a device driver's name.
  587.  
  588.     driverRefNum    input:    The driver reference number.
  589.     driverName        output:    The driver's name.
  590.     
  591.     Result Codes
  592.         noErr                0        No error
  593.         badUnitErr            -21        Bad driver reference number
  594. */
  595.  
  596. /*****************************************************************************/
  597.  
  598. pascal    OSErr    FindDrive(ConstStr255Param pathname,
  599.                           short vRefNum,
  600.                           DrvQElPtr *driveQElementPtr);
  601. /*    ¶ Find a volume's drive queue element in the drive queue.
  602.     The FindDrive function returns a pointer to a mounted volume's
  603.     drive queue element.
  604.  
  605.     pathName            input:    Pointer to a full pathname or nil. If you
  606.                                 pass in a partial pathname, it is ignored.
  607.                                 A full pathname to a volume must end with
  608.                                 a colon character (:).
  609.     vRefNum                input:    Volume specification (volume reference
  610.                                 number, working directory number, drive
  611.                                 number, or 0).
  612.     driveQElementPtr    output:    Pointer to a volume's drive queue element
  613.                                 in the drive queue. DO NOT change the
  614.                                 DrvQEl.
  615.     
  616.     Result Codes
  617.         noErr                0        No error
  618.         nsvErr                -35        No such volume
  619.         paramErr            -50        No default volume
  620.         nsDrvErr            -56        No such drive
  621. */
  622.  
  623. /*****************************************************************************/
  624.  
  625. pascal    OSErr    GetDiskBlocks(ConstStr255Param pathname,
  626.                               short vRefNum,
  627.                               unsigned long *numBlocks);
  628. /*    ¶ Return the number of physical disk blocks on a disk drive.
  629.     The GetDiskBlocks function returns the number of physical disk
  630.     blocks on a disk drive. NOTE: This is not the same as volume
  631.     allocation blocks!
  632.  
  633.     pathName    input:    Pointer to a full pathname or nil. If you
  634.                         pass in a partial pathname, it is ignored.
  635.                         A full pathname to a volume must end with
  636.                         a colon character (:).
  637.     vRefNum        input:    Volume specification (volume reference
  638.                         number, working directory number, drive
  639.                         number, or 0).
  640.     numBlocks    output:    The number of physical disk blocks on the disk drive.
  641.     
  642.     Result Codes
  643.         noErr                0        No error
  644.         nsvErr                -35        No such volume
  645.         paramErr            -50        No default volume, driver reference
  646.                                     number is zero, ReturnFormatList
  647.                                     returned zero blocks, DriveStatus
  648.                                     returned an unknown value, or
  649.                                     driveQElementPtr->qType is unknown
  650.         nsDrvErr            -56        No such drive
  651.         statusErr            –18        Driver does not respond to this
  652.                                     status request
  653.         badUnitErr            –21        Driver reference number does not
  654.                                     match unit table
  655.         unitEmptyErr        –22        Driver reference number specifies
  656.                                     a nil handle in unit table
  657.         abortErr            –27        Request aborted by KillIO
  658.         notOpenErr            –28        Driver not open
  659. */
  660.  
  661. /*****************************************************************************/
  662.  
  663. pascal    OSErr    GetVolFileSystemID(ConstStr255Param pathname,
  664.                                    short vRefNum,
  665.                                    short *fileSystemID);
  666. /*    ¶ Get a volume's file system ID.
  667.     The GetVolFileSystemID function returned the file system ID of
  668.     a mounted volume. The file system ID identifies the file system
  669.     that handles requests to a particular volume. Here's a partial list
  670.     of file system ID numbers (only Apple's file systems are listed):
  671.         FSID    File System
  672.         -----   -----------------------------------------------------
  673.         $0000    Macintosh HFS or MFS
  674.         $0100    ProDOS File System
  675.         $0101    PowerTalk Mail Enclosures
  676.         $4147    ISO 9660 File Access (through Foreign File Access)
  677.         $4242    High Sierra File Access (through Foreign File Access)
  678.         $464D    QuickTake File System (through Foreign File Access)
  679.         $4953    Macintosh PC Exchange (MS-DOS)
  680.         $4A48    Audio CD Access (through Foreign File Access)
  681.         $4D4B    Apple Photo Access (through Foreign File Access)
  682.     
  683.     See the Technical Note "FL 35 - Determining Which File System
  684.     Is Active" and the "Guide to the File System Manager" for more
  685.     information.
  686.     
  687.     pathName        input:    Pointer to a full pathname or nil.  If you pass
  688.                             in a partial pathname, it is ignored. A full
  689.                             pathname to a volume must contain at least
  690.                             one colon character (:) and must not start with
  691.                             a colon character.
  692.     vRefNum            input:    Volume specification (volume reference number,
  693.                             working directory number, drive number, or 0).
  694.     fileSystemID    output:    The volume's file system ID.
  695.     
  696.     Result Codes
  697.         noErr                0        No error
  698.         nsvErr                -35        No such volume
  699.         paramErr            -50        No default volume, or pb was NULL
  700. */
  701.  
  702. /*****************************************************************************/
  703.  
  704. pascal    OSErr    GetVolState(ConstStr255Param pathname,
  705.                             short vRefNum,
  706.                             Boolean *volumeOnline,
  707.                             Boolean *volumeEjected,
  708.                             Boolean *driveEjectable,
  709.                             Boolean *driverWantsEject);
  710. /*    ¶ Returns a volume's online and eject information.
  711.     The GetVolState function determines if a volume is online or offline,
  712.     if an offline volume is ejected, and if the volume's driver is
  713.     ejectable or wants eject calls.
  714.     
  715.     pathName            input:    Pointer to a full pathname or nil.
  716.     vRefNum                input:    Volume specification (volume reference number,
  717.                                 working directory number, drive number, or 0).
  718.     volumeOnline        output:    True if the volume is online;
  719.                                 False if the volume is offline.
  720.     volumeEjected        output:    True if the volume is ejected (ejected
  721.                                 volumes are always offline); False if the
  722.                                 volume is not ejected.
  723.     driveEjectable        output:    True if the volume's drive is ejectable;
  724.                                 False if the volume's drive is not ejectable.
  725.     driverWantsEject    output:    True if the volume's driver wants an Eject
  726.                                 request after unmount (even if the drive
  727.                                 is not ejectable); False if the volume's
  728.                                 driver does not need an eject request.
  729.     
  730.     Result Codes
  731.         noErr                0        No error
  732.         nsvErr                -35        No such volume
  733.         paramErr            -50        No default volume, or pb was NULL
  734. */
  735.  
  736. /*****************************************************************************/
  737.  
  738. pascal    OSErr    UnmountAndEject(ConstStr255Param pathname,
  739.                                 short vRefNum);
  740. /*    ¶ Unmount and eject a volume.
  741.     The UnmountAndEject function unmounts and ejects a volume. The volume
  742.     is ejected only if it is ejectable and not already ejected.
  743.     
  744.     pathName    input:    Pointer to a full pathname or nil.  If you pass in a 
  745.                         partial pathname, it is ignored. A full pathname to a
  746.                         volume must end with a colon character (:).
  747.     vRefNum        input:    Volume specification (volume reference number, working
  748.                         directory number, drive number, or 0).
  749.     
  750.     Result Codes
  751.         noErr                0        No error
  752.         nsvErr                -35        No such volume
  753.         ioErr                -36        I/O error
  754.         bdNamErr            -37        Bad volume name
  755.         fBsyErr                -47        One or more files are open
  756.         paramErr            -50        No default volume
  757.         nsDrvErr            -56        No such drive
  758.         extFSErr            -58        External file system error - no file
  759.                                     system claimed this call.
  760. */
  761.  
  762. /*****************************************************************************/
  763.  
  764. pascal    OSErr    OnLine(FSSpecPtr volumes,
  765.                        short reqVolCount,
  766.                        short *actVolCount,
  767.                        short *volIndex);
  768. /*    ¶ Return the list of volumes currently mounted.
  769.     The OnLine function returns the list of volumes currently mounted in
  770.     an array of FSSpec records.
  771.     
  772.     A noErr result indicates that the volumes array was filled
  773.     (actVolCount == reqVolCount) and there may be additional volumes
  774.     mounted. A nsvErr result indicates that the end of the volume list
  775.     was found and actVolCount volumes were actually found this time.
  776.  
  777.     volumes        input:    Pointer to array of FSSpec where the volume list
  778.                         is returned.
  779.     reqVolCount    input:    Maximum number of volumes to return    (the number of
  780.                         elements in the volumes array).
  781.     actVolCount    output: The number of volumes actually returned.
  782.     volIndex    input:    The current volume index position. Set to 1 to
  783.                         start with the first volume.
  784.                 output:    The volume index position to get the next volume.
  785.                         Pass this value the next time you call OnLine to
  786.                         start where you left off.
  787.     
  788.     Result Codes
  789.         noErr                0        No error, but there are more volumes
  790.                                     to list
  791.         nsvErr                -35        No more volumes to be listed
  792.         paramErr            -50        volIndex was <= 0
  793. */
  794.  
  795. /*****************************************************************************/
  796.  
  797. pascal    OSErr SetDefault(short newVRefNum,
  798.                          long newDirID,
  799.                          short *oldVRefNum,
  800.                          long *oldDirID);
  801. /*    ¶ Set the default volume before making Standard I/O requests.
  802.     The SetDefault function sets the default volume and directory to the
  803.     volume specified by newVRefNum and the directory specified by newDirID.
  804.     The current default volume reference number and directory ID are
  805.     returned in oldVRefNum and oldDir and must be used to restore the
  806.     default volume and directory to their previous state *as soon as
  807.     possible* with the RestoreDefault function. These two functions are
  808.     designed to be used as a wrapper around Standard I/O routines where
  809.     the location of the file is implied to be the default volume and
  810.     directory. In other words, this is how you should use these functions:
  811.     
  812.         error = SetDefault(newVRefNum, newDirID, &oldVRefNum, &oldDirID);
  813.         if ( error == noErr )
  814.         {
  815.             // call the Stdio functions like remove, rename, tmpfile,
  816.             // fopen, freopen, etc. or non-ANSI extensions like
  817.             // fdopen,fsetfileinfo, -- create, open, unlink, etc. here!
  818.             
  819.             error = RestoreDefault(oldVRefNum, oldDirID);
  820.         }
  821.     
  822.     By using these functions as a wrapper, you won't need to open a working
  823.     directory (because SetDefault and RestoreDefault use HSetVol) and you
  824.     won't have to worry about the effects of using HSetVol (documented in
  825.     Technical Note "FL 11 - PBHSetVol is Dangerous" and in the
  826.     Inside Macintosh: Files book in the description of the HSetVol and 
  827.     PBHSetVol functions) because the default volume/directory is restored
  828.     before giving up control to code that might be affected by HSetVol.
  829.     
  830.     newVRefNum    input:    Volume specification (volume reference number,
  831.                         working directory number, drive number, or 0) of
  832.                         the new default volume.
  833.     newDirID    input:    Directory ID of the new default directory.
  834.     oldVRefNum    output: The volume specification to save for use with
  835.                         RestoreDefault.
  836.     oldDirID    output:    The directory ID to save for use with
  837.                         RestoreDefault.
  838.     
  839.     Result Codes
  840.         noErr                0        No error
  841.         nsvErr                -35        No such volume
  842.         bdNamErr            -37        Bad volume name
  843.         fnfErr                -43        Directory not found
  844.         paramErr            -50        No default volume
  845.         afpAccessDenied        -5000    User does not have access to the directory
  846.     
  847.     __________
  848.     
  849.     Also see:    RestoreDefault
  850. */
  851.  
  852. /*****************************************************************************/
  853.  
  854. pascal    OSErr RestoreDefault(short oldVRefNum,
  855.                              long oldDirID);
  856. /*    ¶ Restore the default volume after making Standard C I/O requests.
  857.     The RestoreDefault function restores the default volume and directory
  858.     to the volume specified by oldVRefNum and the directory specified by 
  859.     oldDirID. The oldVRefNum and oldDirID parameters were previously
  860.     obtained from the SetDefault function. These two functions are designed
  861.     to be used as a wrapper around Standard C I/O routines where the
  862.     location of the file is implied to be the default volume and directory.
  863.     In other words, this is how you should use these functions:
  864.     
  865.         error = SetDefault(newVRefNum, newDirID, &oldVRefNum, &oldDirID);
  866.         if ( error == noErr )
  867.         {
  868.             // call the Stdio functions like remove, rename, tmpfile,
  869.             // fopen, freopen, etc. or non-ANSI extensions like
  870.             // fdopen,fsetfileinfo, -- create, open, unlink, etc. here!
  871.             
  872.             error = RestoreDefault(oldVRefNum, oldDirID);
  873.         }
  874.     
  875.     By using these functions as a wrapper, you won't need to open a working
  876.     directory (because SetDefault and RestoreDefault use HSetVol) and you
  877.     won't have to worry about the effects of using HSetVol (documented in
  878.     Technical Note "FL 11 - PBHSetVol is Dangerous" and in the
  879.     Inside Macintosh: Files book in the description of the HSetVol and 
  880.     PBHSetVol functions) because the default volume/directory is restored
  881.     before giving up control to code that might be affected by HSetVol.
  882.     
  883.     oldVRefNum    input: The volume specification to restore.
  884.     oldDirID    input:    The directory ID to restore.
  885.     
  886.     Result Codes
  887.         noErr                0        No error
  888.         nsvErr                -35        No such volume
  889.         bdNamErr            -37        Bad volume name
  890.         fnfErr                -43        Directory not found
  891.         paramErr            -50        No default volume
  892.         rfNumErr            -51        Bad working directory reference number
  893.         afpAccessDenied        -5000    User does not have access to the directory
  894.     
  895.     __________
  896.     
  897.     Also see:    SetDefault
  898. */
  899.  
  900. /*****************************************************************************/
  901.  
  902. pascal    OSErr GetDInfo(short vRefNum,
  903.                        long dirID,
  904.                        ConstStr255Param name,
  905.                        DInfo *fndrInfo);
  906. /*    ¶ Get the finder information for a directory.
  907.     The GetDInfo function gets the finder information for a directory.
  908.  
  909.     vRefNum            input:    Volume specification.
  910.     dirID            input:    Directory ID.
  911.     name            input:    Pointer to object name, or nil when dirID
  912.                             specifies a directory that's the object.
  913.     fndrInfo        output:    If the object is a directory, then its DInfo.
  914.     
  915.     Result Codes
  916.         noErr                0        No error
  917.         nsvErr                -35        No such volume
  918.         ioErr                -36        I/O error
  919.         bdNamErr            -37        Bad filename
  920.         fnfErr                -43        File not found
  921.         paramErr            -50        No default volume
  922.         dirNFErr            -120    Directory not found or incomplete pathname
  923.         afpAccessDenied        -5000    User does not have the correct access
  924.         afpObjectTypeErr    -5025    Directory not found or incomplete pathname
  925.         
  926.     __________
  927.     
  928.     Also see:    FSpGetDInfo, FSpGetFInfoCompat
  929. */
  930.  
  931. /*****************************************************************************/
  932.  
  933. pascal    OSErr FSpGetDInfo(const FSSpec *spec,
  934.                           DInfo *fndrInfo);
  935. /*    ¶ Get the finder information for a directory.
  936.     The FSpGetDInfo function gets the finder information for a directory.
  937.  
  938.     spec        input:    An FSSpec record specifying the directory.
  939.     fndrInfo    output:    If the object is a directory, then its DInfo.
  940.     
  941.     Result Codes
  942.         noErr                0        No error
  943.         nsvErr                -35        No such volume
  944.         ioErr                -36        I/O error
  945.         bdNamErr            -37        Bad filename
  946.         fnfErr                -43        File not found
  947.         paramErr            -50        No default volume
  948.         dirNFErr            -120    Directory not found or incomplete pathname
  949.         afpAccessDenied        -5000    User does not have the correct access
  950.         afpObjectTypeErr    -5025    Directory not found or incomplete pathname
  951.         
  952.     __________
  953.     
  954.     Also see:    FSpGetFInfoCompat, GetDInfo
  955. */
  956.  
  957. /*****************************************************************************/
  958.  
  959. pascal    OSErr SetDInfo(short vRefNum,
  960.                        long dirID,
  961.                        ConstStr255Param name,
  962.                        const DInfo *fndrInfo);
  963. /*    ¶ Set the finder information for a directory.
  964.     The SetDInfo function sets the finder information for a directory.
  965.  
  966.     vRefNum            input:    Volume specification.
  967.     dirID            input:    Directory ID.
  968.     name            input:    Pointer to object name, or nil when dirID
  969.                             specifies a directory that's the object.
  970.     fndrInfo        input:    The DInfo.
  971.     
  972.     Result Codes
  973.         noErr                0        No error
  974.         nsvErr                -35        No such volume
  975.         ioErr                -36        I/O error
  976.         bdNamErr            -37        Bad filename
  977.         fnfErr                -43        File not found
  978.         fLckdErr            -45        File is locked
  979.         vLckdErr            -46        Volume is locked or read-only
  980.         paramErr            -50        No default volume
  981.         dirNFErr            -120    Directory not found or incomplete pathname
  982.         afpAccessDenied        -5000    User does not have the correct access
  983.         afpObjectTypeErr    -5025    Directory not found or incomplete pathname
  984.     
  985.     __________
  986.     
  987.     Also see:    FSpSetDInfo, FSpSetFInfoCompat
  988. */
  989.  
  990. /*****************************************************************************/
  991.  
  992. pascal    OSErr FSpSetDInfo(const FSSpec *spec,
  993.                           const DInfo *fndrInfo);
  994. /*    ¶ Set the finder information for a directory.
  995.     The FSpSetDInfo function sets the finder information for a directory.
  996.  
  997.     spec        input:    An FSSpec record specifying the directory.
  998.     fndrInfo    input:    The DInfo.
  999.     
  1000.     Result Codes
  1001.         noErr                0        No error
  1002.         nsvErr                -35        No such volume
  1003.         ioErr                -36        I/O error
  1004.         bdNamErr            -37        Bad filename
  1005.         fnfErr                -43        File not found
  1006.         fLckdErr            -45        File is locked
  1007.         vLckdErr            -46        Volume is locked or read-only
  1008.         paramErr            -50        No default volume
  1009.         dirNFErr            -120    Directory not found or incomplete pathname
  1010.         afpAccessDenied        -5000    User does not have the correct access
  1011.         afpObjectTypeErr    -5025    Directory not found or incomplete pathname
  1012.     
  1013.     __________
  1014.     
  1015.     Also see:    FSpSetFInfoCompat, SetDInfo
  1016. */
  1017.  
  1018. /*****************************************************************************/
  1019.  
  1020. #if OLDROUTINENAMES
  1021. #define    GetDirID(vRefNum, dirID, name, theDirID, isDirectory)    \
  1022.         GetDirectoryID(vRefNum, dirID, name, theDirID, isDirectory)
  1023. #endif
  1024.  
  1025. pascal    OSErr    GetDirectoryID(short vRefNum,
  1026.                                long dirID,
  1027.                                ConstStr255Param name,
  1028.                                long *theDirID,
  1029.                                Boolean *isDirectory);
  1030. /*    ¶ Get the directory ID number of the directory specified.
  1031.     The GetDirectoryID function gets the directory ID number of the
  1032.     directory specified.  If a file is specified, then the parent
  1033.     directory of the file is returned and isDirectory is false.  If
  1034.     a directory is specified, then that directory's ID number is
  1035.     returned and isDirectory is true.
  1036.     WARNING: Volume names on the Macintosh are *not* unique -- Multiple
  1037.     mounted volumes can have the same name. For this reason, the use of a
  1038.     volume name or full pathname to identify a specific volume may not
  1039.     produce the results you expect.  If more than one volume has the same
  1040.     name and a volume name or full pathname is used, the File Manager
  1041.     currently uses the first volume it finds with a matching name in the
  1042.     volume queue.
  1043.     
  1044.     vRefNum            input:    Volume specification.
  1045.     dirID            input:    Directory ID.
  1046.     name            input:    Pointer to object name, or nil when dirID
  1047.                             specifies a directory that's the object.
  1048.     theDirID        output:    If the object is a file, then its parent directory
  1049.                             ID. If the object is a directory, then its ID.
  1050.     isDirectory        output:    True if object is a directory; false if
  1051.                             object is a file.
  1052.     
  1053.     Result Codes
  1054.         noErr                0        No error
  1055.         nsvErr                -35        No such volume
  1056.         ioErr                -36        I/O error
  1057.         bdNamErr            -37        Bad filename
  1058.         fnfErr                -43        File not found
  1059.         paramErr            -50        No default volume
  1060.         dirNFErr            -120    Directory not found or incomplete pathname
  1061.         afpAccessDenied        -5000    User does not have the correct access
  1062.         afpObjectTypeErr    -5025    Directory not found or incomplete pathname
  1063. */
  1064.  
  1065. /*****************************************************************************/
  1066.  
  1067. #if OLDROUTINENAMES
  1068. #define    DirIDFromFSSpec(spec, theDirID, isDirectory)    \
  1069.         FSpGetDirectoryID(spec, theDirID, isDirectory)
  1070. #endif
  1071.  
  1072. pascal    OSErr    FSpGetDirectoryID(const FSSpec *spec,
  1073.                                   long *theDirID,
  1074.                                   Boolean *isDirectory);
  1075. /*    ¶ Get the directory ID number of a directory.
  1076.     The FSpGetDirectoryID function gets the directory ID number of the
  1077.     directory specified by spec. If spec is to a file, then the parent
  1078.     directory of the file is returned and isDirectory is false.  If
  1079.     spec is to a directory, then that directory's ID number is
  1080.     returned and isDirectory is true.
  1081.     
  1082.     spec            input:    An FSSpec record specifying the directory.
  1083.     theDirID        output:    The directory ID.
  1084.     isDirectory        output:    True if object is a directory; false if
  1085.                             object is a file.
  1086.     
  1087.     Result Codes
  1088.         noErr                0        No error
  1089.         nsvErr                -35        No such volume
  1090.         ioErr                -36        I/O error
  1091.         bdNamErr            -37        Bad filename
  1092.         fnfErr                -43        File not found
  1093.         paramErr            -50        No default volume
  1094.         dirNFErr            -120    Directory not found or incomplete pathname
  1095.         afpAccessDenied        -5000    User does not have the correct access
  1096.         afpObjectTypeErr    -5025    Directory not found or incomplete pathname
  1097. */
  1098.  
  1099. /*****************************************************************************/
  1100.  
  1101. pascal    OSErr    GetDirName(short vRefNum,
  1102.                            long dirID,
  1103.                            Str31 name);
  1104. /*    ¶ Get the name of a directory from its directory ID.
  1105.     The GetDirName function gets the name of a directory from its
  1106.     directory ID.
  1107.  
  1108.     vRefNum        input:    Volume specification.
  1109.     dirID        input:    Directory ID.
  1110.     name        output:    Points to a Str31 where the directory name is to be
  1111.                         returned.
  1112.     
  1113.     Result Codes
  1114.         noErr                0        No error
  1115.         nsvErr                -35        No such volume
  1116.         ioErr                -36        I/O error
  1117.         bdNamErr            -37        Bad filename
  1118.         fnfErr                -43        File not found
  1119.         paramErr            -50        No default volume or
  1120.                                     name parameter was NULL
  1121.         dirNFErr            -120    Directory not found or incomplete pathname
  1122.         afpAccessDenied        -5000    User does not have the correct access
  1123.         afpObjectTypeErr    -5025    Directory not found or incomplete pathname
  1124. */
  1125.  
  1126. /*****************************************************************************/
  1127.  
  1128. pascal    OSErr    GetIOACUser(short vRefNum,
  1129.                             long dirID,
  1130.                             ConstStr255Param name,
  1131.                             SInt8 *ioACUser);
  1132. /*    ¶ Get a directory's access restrictions byte.
  1133.     GetIOACUser returns a directory's access restrictions byte.
  1134.     Use the masks and macro defined in MoreFilesExtras to check for
  1135.     specific access priviledges.
  1136.     
  1137.     vRefNum        input:    Volume specification.
  1138.     dirID        input:    Directory ID.
  1139.     name        input:    Pointer to object name, or nil when dirID
  1140.                         specifies a directory that's the object.
  1141.     ioACUser    output:    The access restriction byte
  1142.     
  1143.     Result Codes
  1144.         noErr                0        No error
  1145.         nsvErr                -35        No such volume
  1146.         ioErr                -36        I/O error
  1147.         bdNamErr            -37        Bad filename
  1148.         fnfErr                -43        File not found
  1149.         paramErr            -50        No default volume
  1150.         dirNFErr            -120    Directory not found or incomplete pathname
  1151.         afpAccessDenied        -5000    User does not have the correct access
  1152.         afpObjectTypeErr    -5025    Directory not found or incomplete pathname
  1153. */
  1154.  
  1155. /*****************************************************************************/
  1156.  
  1157. pascal    OSErr    FSpGetIOACUser(const FSSpec *spec,
  1158.                                SInt8 *ioACUser);
  1159. /*    ¶ Get a directory's access restrictions byte.
  1160.     FSpGetIOACUser returns a directory's access restrictions byte.
  1161.     Use the masks and macro defined in MoreFilesExtras to check for
  1162.     specific access priviledges.
  1163.     
  1164.     spec        input:    An FSSpec record specifying the directory.
  1165.     ioACUser    output:    The access restriction byte
  1166.     
  1167.     Result Codes
  1168.         noErr                0        No error
  1169.         nsvErr                -35        No such volume
  1170.         ioErr                -36        I/O error
  1171.         bdNamErr            -37        Bad filename
  1172.         fnfErr                -43        File not found
  1173.         paramErr            -50        No default volume
  1174.         dirNFErr            -120    Directory not found or incomplete pathname
  1175.         afpAccessDenied        -5000    User does not have the correct access
  1176.         afpObjectTypeErr    -5025    Directory not found or incomplete pathname
  1177. */
  1178.  
  1179. /*****************************************************************************/
  1180.  
  1181. pascal    OSErr    GetParentID(short vRefNum,
  1182.                             long dirID,
  1183.                             ConstStr255Param name,
  1184.                             long *parID);
  1185. /*    ¶ Get the parent directory ID number of the specified object.
  1186.     The GetParentID function gets the parent directory ID number of the
  1187.     specified object.
  1188.     
  1189.     vRefNum        input:    Volume specification.
  1190.     dirID        input:    Directory ID.
  1191.     name        input:    Pointer to object name, or nil when dirID specifies
  1192.                         a directory that's the object.
  1193.     parID        output:    The parent directory ID of the specified object.
  1194.     
  1195.     Result Codes
  1196.         noErr                0        No error
  1197.         nsvErr                -35        No such volume
  1198.         ioErr                -36        I/O error
  1199.         bdNamErr            -37        Bad filename
  1200.         fnfErr                -43        File not found
  1201.         paramErr            -50        No default volume
  1202.         dirNFErr            -120    Directory not found or incomplete pathname
  1203.         afpAccessDenied        -5000    User does not have the correct access
  1204.         afpObjectTypeErr    -5025    Directory not found or incomplete pathname
  1205. */
  1206.  
  1207. /*****************************************************************************/
  1208.  
  1209. pascal    OSErr    GetFilenameFromPathname(ConstStr255Param pathname,
  1210.                                         Str255 filename);
  1211. /*    ¶ Get the object name from the end of a full or partial pathname.
  1212.     The GetFilenameFromPathname function gets the file (or directory) name
  1213.     from the end of a full or partial pathname. Returns notAFileErr if the
  1214.     pathname is nil, the pathname is empty, or the pathname cannot refer to
  1215.     a filename (with a noErr result, the pathname could still refer to a
  1216.     directory).
  1217.     
  1218.     pathname    input:    A full or partial pathname.
  1219.     filename    output:    The file (or directory) name.
  1220.     
  1221.     Result Codes
  1222.         noErr                0        No error
  1223.         notAFileErr            -1302    The pathname is nil, the pathname
  1224.                                     is empty, or the pathname cannot refer
  1225.                                     to a filename
  1226.     
  1227.     __________
  1228.     
  1229.     See also:    GetObjectLocation.
  1230. */
  1231.  
  1232. /*****************************************************************************/
  1233.  
  1234. pascal    OSErr    GetObjectLocation(short vRefNum,
  1235.                                   long dirID,
  1236.                                   ConstStr255Param pathname,
  1237.                                   short *realVRefNum,
  1238.                                   long *realParID,
  1239.                                   Str255 realName,
  1240.                                   Boolean *isDirectory);
  1241. /*    ¶ Get a file system object's location.
  1242.     The GetObjectLocation function gets a file system object's location -
  1243.     that is, its real volume reference number, real parent directory ID,
  1244.     and name. While we're at it, determine if the object is a file or directory.
  1245.     If GetObjectLocation returns fnfErr, then the location information
  1246.     returned is valid, but it describes an object that doesn't exist.
  1247.     You can use the location information for another operation, such as
  1248.     creating a file or directory.
  1249.     
  1250.     vRefNum        input:    Volume specification.
  1251.     dirID        input:    Directory ID.
  1252.     pathname    input:    Pointer to object name, or nil when dirID specifies
  1253.                         a directory that's the object.
  1254.     realVRefNum    output:    The real volume reference number.
  1255.     realParID    output:    The parent directory ID of the specified object.
  1256.     realName    output:    The name of the specified object (the case of the
  1257.                         object name may not be the same as the object's
  1258.                         catalog entry on disk - since the Macintosh file
  1259.                         system is not case sensitive, it shouldn't matter).
  1260.     isDirectory    output:    True if object is a directory; false if object
  1261.                         is a file.
  1262.     
  1263.     Result Codes
  1264.         noErr                0        No error
  1265.         nsvErr                -35        No such volume
  1266.         ioErr                -36        I/O error
  1267.         bdNamErr            -37        Bad filename
  1268.         fnfErr                -43        File not found
  1269.         paramErr            -50        No default volume
  1270.         dirNFErr            -120    Directory not found or incomplete pathname
  1271.         notAFileErr            -1302    The pathname is nil, the pathname
  1272.                                     is empty, or the pathname cannot refer
  1273.                                     to a filename
  1274.         afpAccessDenied        -5000    User does not have the correct access
  1275.         afpObjectTypeErr    -5025    Directory not found or incomplete pathname
  1276.     
  1277.     __________
  1278.     
  1279.     See also:    FSMakeFSSpecCompat
  1280. */
  1281.  
  1282. /*****************************************************************************/
  1283.  
  1284. pascal    OSErr    GetDirItems(short vRefNum,
  1285.                             long dirID,
  1286.                             ConstStr255Param name,
  1287.                             Boolean getFiles,
  1288.                             Boolean getDirectories,
  1289.                             FSSpecPtr items,
  1290.                             short reqItemCount,
  1291.                             short *actItemCount,
  1292.                             short *itemIndex);
  1293. /*    ¶ Return a list of items in a directory.
  1294.     The GetDirItems function returns a list of items in the specified
  1295.     directory in an array of FSSpec records. File, subdirectories, or
  1296.     both can be returned in the list.
  1297.     
  1298.     A noErr result indicates that the items array was filled
  1299.     (actItemCount == reqItemCount) and there may be additional items
  1300.     left in the directory. A fnfErr result indicates that the end of
  1301.     the directory list was found and actItemCount items were actually
  1302.     found this time.
  1303.  
  1304.     vRefNum            input:    Volume specification.
  1305.     dirID            input:    Directory ID.
  1306.     name            input:    Pointer to object name, or nil when dirID
  1307.                             specifies a directory that's the object.
  1308.     getFiles        input:    Pass true to have files added to the items list.
  1309.     getDirectories    input:    Pass true to have directories added to the
  1310.                             items list.
  1311.     items            input:    Pointer to array of FSSpec where the item list
  1312.                             is returned.
  1313.     reqItemCount    input:    Maximum number of items to return (the number
  1314.                             of elements in the items array).
  1315.     actItemCount    output: The number of items actually returned.
  1316.     itemIndex        input:    The current item index position. Set to 1 to
  1317.                             start with the first item in the directory.
  1318.                     output:    The item index position to get the next item.
  1319.                             Pass this value the next time you call
  1320.                             GetDirItems to start where you left off.
  1321.     
  1322.     Result Codes
  1323.         noErr                0        No error, but there are more items
  1324.                                     to list
  1325.         nsvErr                -35        No such volume
  1326.         ioErr                -36        I/O error
  1327.         bdNamErr            -37        Bad filename
  1328.         fnfErr                -43        File not found, there are no more items
  1329.                                     to be listed.
  1330.         paramErr            -50        No default volume or itemIndex was <= 0
  1331.         dirNFErr            -120    Directory not found or incomplete pathname
  1332.         afpAccessDenied        -5000    User does not have the correct access
  1333.         afpObjectTypeErr    -5025    Directory not found or incomplete pathname
  1334. */
  1335.  
  1336. /*****************************************************************************/
  1337.  
  1338. pascal    OSErr    DeleteDirectoryContents(short vRefNum,
  1339.                                          long dirID,
  1340.                                         ConstStr255Param name);
  1341. /*    ¶ Delete the contents of a directory.
  1342.     The DeleteDirectoryContents function deletes the contents of a directory.
  1343.     All files and subdirectories in the specified directory are deleted.
  1344.     If a locked file or directory is encountered, it is unlocked and then
  1345.     deleted.  If any unexpected errors are encountered,
  1346.     DeleteDirectoryContents quits and returns to the caller.
  1347.     
  1348.     vRefNum    input:    Volume specification.
  1349.     dirID    input:    Directory ID.
  1350.     name    input:    Pointer to directory name, or nil when dirID specifies
  1351.                     a directory that's the object.
  1352.     
  1353.     Result Codes
  1354.         noErr                0        No error
  1355.         nsvErr                -35        No such volume
  1356.         ioErr                -36        I/O error
  1357.         bdNamErr            -37        Bad filename
  1358.         fnfErr                -43        File not found
  1359.         wPrErr                -44        Hardware volume lock    
  1360.         fLckdErr            -45        File is locked    
  1361.         vLckdErr            -46        Software volume lock    
  1362.         fBsyErr                -47        File busy, directory not empty, or working directory control block open    
  1363.         paramErr            -50        No default volume
  1364.         dirNFErr            -120    Directory not found or incomplete pathname
  1365.         afpAccessDenied        -5000    User does not have the correct access
  1366.         afpObjectTypeErr    -5025    Directory not found or incomplete pathname
  1367.     
  1368.     __________
  1369.     
  1370.     Also see:    DeleteDirectory
  1371. */
  1372.  
  1373. /*****************************************************************************/
  1374.  
  1375. pascal    OSErr    DeleteDirectory(short vRefNum,
  1376.                                 long dirID,
  1377.                                 ConstStr255Param name);
  1378. /*    ¶ Delete a directory and its contents.
  1379.     The DeleteDirectory function deletes a directory and its contents.
  1380.     All files and subdirectories in the specified directory are deleted.
  1381.     If a locked file or directory is encountered, it is unlocked and then
  1382.     deleted.  After deleting the directories contents, the directory is
  1383.     deleted. If any unexpected errors are encountered, DeleteDirectory
  1384.     quits and returns to the caller.
  1385.     
  1386.     vRefNum    input:    Volume specification.
  1387.     dirID    input:    Directory ID.
  1388.     name    input:    Pointer to directory name, or nil when dirID specifies
  1389.                     a directory that's the object.
  1390.     
  1391.     Result Codes
  1392.         noErr                0        No error
  1393.         nsvErr                -35        No such volume
  1394.         ioErr                -36        I/O error
  1395.         bdNamErr            -37        Bad filename
  1396.         fnfErr                -43        File not found
  1397.         wPrErr                -44        Hardware volume lock
  1398.         fLckdErr            -45        File is locked
  1399.         vLckdErr            -46        Software volume lock
  1400.         fBsyErr                -47        File busy, directory not empty, or working directory control block open    
  1401.         paramErr            -50        No default volume
  1402.         dirNFErr            -120    Directory not found or incomplete pathname
  1403.         afpAccessDenied        -5000    User does not have the correct access
  1404.         afpObjectTypeErr    -5025    Directory not found or incomplete pathname
  1405.     
  1406.     __________
  1407.     
  1408.     Also see:    DeleteDirectoryContents
  1409. */
  1410.  
  1411. /*****************************************************************************/
  1412.  
  1413. pascal    OSErr    CheckObjectLock(short vRefNum,
  1414.                                 long dirID,
  1415.                                 ConstStr255Param name);
  1416. /*    ¶ Determine if a file or directory is locked.
  1417.     The CheckObjectLock function determines if a file or directory is locked.
  1418.     If CheckObjectLock returns noErr, then the file or directory
  1419.     is not locked. If CheckObjectLock returns fLckdErr, the it is locked.
  1420.     
  1421.     vRefNum    input:    Volume specification.
  1422.     dirID    input:    Directory ID.
  1423.     name    input:    Pointer to object name, or nil when dirID specifies
  1424.                     a directory that's the object.
  1425.     
  1426.     Result Codes
  1427.         noErr                0        No error
  1428.         nsvErr                -35        No such volume
  1429.         ioErr                -36        I/O error
  1430.         bdNamErr            -37        Bad filename
  1431.         fnfErr                -43        File not found
  1432.         fLckdErr            -45        File is locked
  1433.         paramErr            -50        No default volume
  1434.         dirNFErr            -120    Directory not found or incomplete pathname
  1435.         afpAccessDenied        -5000    User does not have the correct access
  1436.         afpObjectTypeErr    -5025    Directory not found or incomplete pathname
  1437.     
  1438.     __________
  1439.     
  1440.     Also see:    FSpCheckObjectLock
  1441. */
  1442.  
  1443. /*****************************************************************************/
  1444.  
  1445. pascal    OSErr    FSpCheckObjectLock(const FSSpec *spec);
  1446. /*    ¶ Determine if a file or directory is locked.
  1447.     The FSpCheckObjectLock function determines if a file or directory is locked.
  1448.     If FSpCheckObjectLock returns noErr, then the file or directory
  1449.     is not locked.
  1450.     
  1451.     spec    input:    An FSSpec record specifying the object.
  1452.     
  1453.     Result Codes
  1454.         noErr                0        No error
  1455.         nsvErr                -35        No such volume
  1456.         ioErr                -36        I/O error
  1457.         bdNamErr            -37        Bad filename
  1458.         fnfErr                -43        File not found
  1459.         fLckdErr            -45        File is locked
  1460.         paramErr            -50        No default volume
  1461.         dirNFErr            -120    Directory not found or incomplete pathname
  1462.         afpAccessDenied        -5000    User does not have the correct access
  1463.         afpObjectTypeErr    -5025    Directory not found or incomplete pathname
  1464.     
  1465.     __________
  1466.     
  1467.     Also see:    CheckObjectLock
  1468. */
  1469.  
  1470. /*****************************************************************************/
  1471.  
  1472. pascal    OSErr    GetFileSize(short vRefNum,
  1473.                             long dirID,
  1474.                             ConstStr255Param fileName,
  1475.                             long *dataSize,
  1476.                             long *rsrcSize);
  1477. /*    ¶ Get the logical sizes of a file's forks.
  1478.     The GetFileSize function returns the logical size of a file's
  1479.     data and resource fork.
  1480.     
  1481.     vRefNum        input:    Volume specification.
  1482.     dirID        input:    Directory ID.
  1483.     name        input:    The name of the file.
  1484.     dataSize    output:    The number of bytes in the file's data fork.
  1485.     rsrcSize    output:    The number of bytes in the file's resource fork.
  1486.     
  1487.     Result Codes
  1488.         noErr                0        No error
  1489.         nsvErr                -35        No such volume
  1490.         ioErr                -36        I/O error
  1491.         bdNamErr            -37        Bad filename
  1492.         fnfErr                -43        File not found
  1493.         paramErr            -50        No default volume
  1494.         dirNFErrdirNFErr    -120    Directory not found or incomplete pathname
  1495.         afpAccessDenied        -5000    User does not have the correct access
  1496.         afpObjectTypeErr    -5025    Directory not found or incomplete pathname
  1497.     
  1498.     __________
  1499.     
  1500.     See also:    FSpGetFileSize
  1501. */
  1502.  
  1503. /*****************************************************************************/
  1504.  
  1505. pascal    OSErr    FSpGetFileSize(const FSSpec *spec,
  1506.                                long *dataSize,
  1507.                                long *rsrcSize);
  1508. /*    ¶ Get the logical sizes of a file's forks.
  1509.     The FSpGetFileSize function returns the logical size of a file's
  1510.     data and resource fork.
  1511.     
  1512.     spec        input:    An FSSpec record specifying the file.
  1513.     dataSize    output:    The number of bytes in the file's data fork.
  1514.     rsrcSize    output:    The number of bytes in the file's resource fork.
  1515.     
  1516.     Result Codes
  1517.         noErr                0        No error
  1518.         nsvErr                -35        No such volume
  1519.         ioErr                -36        I/O error
  1520.         bdNamErr            -37        Bad filename
  1521.         fnfErr                -43        File not found
  1522.         paramErr            -50        No default volume
  1523.         dirNFErrdirNFErr    -120    Directory not found or incomplete pathname
  1524.         afpAccessDenied        -5000    User does not have the correct access
  1525.         afpObjectTypeErr    -5025    Directory not found or incomplete pathname
  1526.     
  1527.     __________
  1528.     
  1529.     See also:    GetFileSize
  1530. */
  1531.  
  1532. /*****************************************************************************/
  1533.  
  1534. pascal    OSErr    BumpDate(short vRefNum,
  1535.                          long dirID,
  1536.                          ConstStr255Param name);
  1537. /*    ¶ Update the modification date of a file or directory.
  1538.     The BumpDate function changes the modification date of a file or
  1539.     directory to the current date/time.  If the modification date is already
  1540.     equal to the current date/time, then add one second to the
  1541.     modification date.
  1542.     
  1543.     vRefNum    input:    Volume specification.
  1544.     dirID    input:    Directory ID.
  1545.     name    input:    Pointer to object name, or nil when dirID specifies
  1546.                     a directory that's the object.
  1547.     
  1548.     Result Codes
  1549.         noErr                0        No error
  1550.         nsvErr                -35        No such volume
  1551.         ioErr                -36        I/O error
  1552.         bdNamErr            -37        Bad filename
  1553.         fnfErr                -43        File not found
  1554.         fLckdErr            -45        File is locked
  1555.         vLckdErr            -46        Volume is locked or read-only
  1556.         paramErr            -50        No default volume
  1557.         dirNFErr            -120    Directory not found or incomplete pathname
  1558.         afpAccessDenied        -5000    User does not have the correct access
  1559.         afpObjectTypeErr    -5025    Directory not found or incomplete pathname
  1560.     
  1561.     __________
  1562.     
  1563.     See also:    FSpBumpDate
  1564. */
  1565.  
  1566. /*****************************************************************************/
  1567.  
  1568. pascal    OSErr    FSpBumpDate(const FSSpec *spec);
  1569. /*    ¶ Update the modification date of a file or directory.
  1570.     The FSpBumpDate function changes the modification date of a file or
  1571.     directory to the current date/time.  If the modification date is already
  1572.     equal to the current date/time, then add one second to the
  1573.     modification date.
  1574.     
  1575.     spec    input:    An FSSpec record specifying the object.
  1576.     
  1577.     Result Codes
  1578.         noErr                0        No error
  1579.         nsvErr                -35        No such volume
  1580.         ioErr                -36        I/O error
  1581.         bdNamErr            -37        Bad filename
  1582.         fnfErr                -43        File not found
  1583.         fLckdErr            -45        File is locked
  1584.         vLckdErr            -46        Volume is locked or read-only
  1585.         paramErr            -50        No default volume
  1586.         dirNFErr            -120    Directory not found or incomplete pathname
  1587.         afpAccessDenied        -5000    User does not have the correct access
  1588.         afpObjectTypeErr    -5025    Directory not found or incomplete pathname
  1589.     
  1590.     __________
  1591.     
  1592.     See also:    BumpDate
  1593. */
  1594.  
  1595. /*****************************************************************************/
  1596.  
  1597. pascal    OSErr    ChangeCreatorType(short vRefNum,
  1598.                                   long dirID,
  1599.                                   ConstStr255Param name,
  1600.                                   OSType creator,
  1601.                                   OSType fileType);
  1602. /*    ¶ Change the creator or file type of a file.
  1603.     The ChangeCreatorType function changes the creator or file type of a file.
  1604.  
  1605.     vRefNum        input:    Volume specification.
  1606.     dirID        input:    Directory ID.
  1607.     name        input:    The name of the file.
  1608.     creator        input:    The new creator type or 0x00000000 to leave
  1609.                         the creator type alone.
  1610.     fileType    input:    The new file type or 0x00000000 to leave the
  1611.                         file type alone.
  1612.     
  1613.     Result Codes
  1614.         noErr                0        No error
  1615.         nsvErr                -35        No such volume
  1616.         ioErr                -36        I/O error
  1617.         bdNamErr            -37        Bad filename
  1618.         fnfErr                -43        File not found
  1619.         fLckdErr            -45        File is locked
  1620.         vLckdErr            -46        Volume is locked or read-only
  1621.         paramErr            -50        No default volume
  1622.         dirNFErr            -120    Directory not found or incomplete pathname
  1623.         notAFileErr            -1302    Name was not a file
  1624.         afpAccessDenied        -5000    User does not have the correct access
  1625.         afpObjectTypeErr    -5025    Directory not found or incomplete pathname
  1626.     
  1627.     __________
  1628.     
  1629.     See also:    FSpChangeCreatorType
  1630. */
  1631.  
  1632. /*****************************************************************************/
  1633.  
  1634. pascal    OSErr    FSpChangeCreatorType(const FSSpec *spec,
  1635.                                      OSType creator,
  1636.                                      OSType fileType);
  1637. /*    ¶ Change the creator or file type of a file.
  1638.     The FSpChangeCreatorType function changes the creator or file type of a file.
  1639.  
  1640.     spec        input:    An FSSpec record specifying the file.
  1641.     creator        input:    The new creator type or 0x00000000 to leave
  1642.                         the creator type alone.
  1643.     fileType    input:    The new file type or 0x00000000 to leave the
  1644.                         file type alone.
  1645.     
  1646.     Result Codes
  1647.         noErr                0        No error
  1648.         nsvErr                -35        No such volume
  1649.         ioErr                -36        I/O error
  1650.         bdNamErr            -37        Bad filename
  1651.         fnfErr                -43        File not found
  1652.         fLckdErr            -45        File is locked
  1653.         vLckdErr            -46        Volume is locked or read-only
  1654.         paramErr            -50        No default volume
  1655.         dirNFErr            -120    Directory not found or incomplete pathname
  1656.         notAFileErr            -1302    Name was not a file
  1657.         afpAccessDenied        -5000    User does not have the correct access
  1658.         afpObjectTypeErr    -5025    Directory not found or incomplete pathname
  1659.     
  1660.     __________
  1661.     
  1662.     See also:    ChangeCreatorType
  1663. */
  1664.  
  1665. /*****************************************************************************/
  1666.  
  1667. pascal    OSErr    ChangeFDFlags(short vRefNum,
  1668.                               long dirID,
  1669.                               ConstStr255Param name,
  1670.                               Boolean    setBits,
  1671.                               unsigned short flagBits);
  1672. /*    ¶ Set or clear Finder Flag bits.
  1673.     The ChangeFDFlags function sets or clears Finder Flag bits in the
  1674.     fdFlags field of a file or directory's FInfo record.
  1675.     
  1676.     vRefNum        input:    Volume specification.
  1677.     dirID        input:    Directory ID.
  1678.     name        input:    Pointer to object name, or nil when dirID specifies
  1679.                         a directory that's the object.
  1680.     setBits        input:    If true, then set the bits specified in flagBits.
  1681.                         If false, then clear the bits specified in flagBits.
  1682.     flagBits    input:    The flagBits parameter specifies which Finder Flag
  1683.                         bits to set or clear. If a bit in flagBits is set,
  1684.                         then the same bit in fdFlags is either set or
  1685.                         cleared depending on the state of the setBits
  1686.                         parameter.
  1687.     
  1688.     Result Codes
  1689.         noErr                0        No error
  1690.         nsvErr                -35        No such volume
  1691.         ioErr                -36        I/O error
  1692.         bdNamErr            -37        Bad filename
  1693.         fnfErr                -43        File not found
  1694.         fLckdErr            -45        File is locked
  1695.         vLckdErr            -46        Volume is locked or read-only
  1696.         paramErr            -50        No default volume
  1697.         dirNFErr            -120    Directory not found or incomplete pathname
  1698.         afpAccessDenied        -5000    User does not have the correct access
  1699.         afpObjectTypeErr    -5025    Directory not found or incomplete pathname
  1700.     
  1701.     __________
  1702.     
  1703.     See also:    FSpChangeFDFlags
  1704. */
  1705.  
  1706. /*****************************************************************************/
  1707.  
  1708. pascal    OSErr    FSpChangeFDFlags(const FSSpec *spec,
  1709.                                  Boolean setBits,
  1710.                                  unsigned short flagBits);
  1711. /*    ¶ Set or clear Finder Flag bits.
  1712.     The FSpChangeFDFlags function sets or clears Finder Flag bits in the
  1713.     fdFlags field of a file or directory's FInfo record.
  1714.     
  1715.     spec        input:    An FSSpec record specifying the object.
  1716.     setBits        input:    If true, then set the bits specified in flagBits.
  1717.                         If false, then clear the bits specified in flagBits.
  1718.     flagBits    input:    The flagBits parameter specifies which Finder Flag
  1719.                         bits to set or clear. If a bit in flagBits is set,
  1720.                         then the same bit in fdFlags is either set or
  1721.                         cleared depending on the state of the setBits
  1722.                         parameter.
  1723.     
  1724.     Result Codes
  1725.         noErr                0        No error
  1726.         nsvErr                -35        No such volume
  1727.         ioErr                -36        I/O error
  1728.         bdNamErr            -37        Bad filename
  1729.         fnfErr                -43        File not found
  1730.         fLckdErr            -45        File is locked
  1731.         vLckdErr            -46        Volume is locked or read-only
  1732.         paramErr            -50        No default volume
  1733.         dirNFErr            -120    Directory not found or incomplete pathname
  1734.         afpAccessDenied        -5000    User does not have the correct access
  1735.         afpObjectTypeErr    -5025    Directory not found or incomplete pathname
  1736.     
  1737.     __________
  1738.     
  1739.     See also:    ChangeFDFlags
  1740. */
  1741.  
  1742. /*****************************************************************************/
  1743.  
  1744. pascal    OSErr    SetIsInvisible(short vRefNum,
  1745.                                long dirID,
  1746.                                ConstStr255Param name);
  1747. /*    ¶ Set the invisible Finder Flag bit.
  1748.     The SetIsInvisible function sets the invisible bit in the fdFlags
  1749.     word of the specified file or directory's finder information.
  1750.     
  1751.     vRefNum    input:    Volume specification.
  1752.     dirID    input:    Directory ID.
  1753.     name    input:    Pointer to object name, or nil when dirID specifies
  1754.                     a directory that's the object.
  1755.     
  1756.     Result Codes
  1757.         noErr                0        No error
  1758.         nsvErr                -35        No such volume
  1759.         ioErr                -36        I/O error
  1760.         bdNamErr            -37        Bad filename
  1761.         fnfErr                -43        File not found
  1762.         fLckdErr            -45        File is locked
  1763.         vLckdErr            -46        Volume is locked or read-only
  1764.         paramErr            -50        No default volume
  1765.         dirNFErr            -120    Directory not found or incomplete pathname
  1766.         afpAccessDenied        -5000    User does not have the correct access
  1767.         afpObjectTypeErr    -5025    Directory not found or incomplete pathname
  1768.     
  1769.     __________
  1770.     
  1771.     See also:    FSpSetIsInvisible, ClearIsInvisible, FSpClearIsInvisible
  1772. */
  1773.  
  1774. /*****************************************************************************/
  1775.  
  1776. pascal    OSErr    FSpSetIsInvisible(const FSSpec *spec);
  1777. /*    ¶ Set the invisible Finder Flag bit.
  1778.     The FSpSetIsInvisible function sets the invisible bit in the fdFlags
  1779.     word of the specified file or directory's finder information.
  1780.     
  1781.     spec    input:    An FSSpec record specifying the object.
  1782.     
  1783.     Result Codes
  1784.         noErr                0        No error
  1785.         nsvErr                -35        No such volume
  1786.         ioErr                -36        I/O error
  1787.         bdNamErr            -37        Bad filename
  1788.         fnfErr                -43        File not found
  1789.         fLckdErr            -45        File is locked
  1790.         vLckdErr            -46        Volume is locked or read-only
  1791.         paramErr            -50        No default volume
  1792.         dirNFErr            -120    Directory not found or incomplete pathname
  1793.         afpAccessDenied        -5000    User does not have the correct access
  1794.         afpObjectTypeErr    -5025    Directory not found or incomplete pathname
  1795.     
  1796.     __________
  1797.     
  1798.     See also:    SetIsInvisible, ClearIsInvisible, FSpClearIsInvisible
  1799. */
  1800.  
  1801. /*****************************************************************************/
  1802.  
  1803. pascal    OSErr    ClearIsInvisible(short vRefNum,
  1804.                                  long dirID,
  1805.                                  ConstStr255Param name);
  1806. /*    ¶ Clear the invisible Finder Flag bit.
  1807.     The ClearIsInvisible function clears the invisible bit in the fdFlags
  1808.     word of the specified file or directory's finder information.
  1809.     
  1810.     vRefNum    input:    Volume specification.
  1811.     dirID    input:    Directory ID.
  1812.     name    input:    Pointer to object name, or nil when dirID specifies
  1813.                     a directory that's the object.
  1814.     
  1815.     Result Codes
  1816.         noErr                0        No error
  1817.         nsvErr                -35        No such volume
  1818.         ioErr                -36        I/O error
  1819.         bdNamErr            -37        Bad filename
  1820.         fnfErr                -43        File not found
  1821.         fLckdErr            -45        File is locked
  1822.         vLckdErr            -46        Volume is locked or read-only
  1823.         paramErr            -50        No default volume
  1824.         dirNFErr            -120    Directory not found or incomplete pathname
  1825.         afpAccessDenied        -5000    User does not have the correct access
  1826.         afpObjectTypeErr    -5025    Directory not found or incomplete pathname
  1827.     
  1828.     __________
  1829.     
  1830.     See also:    SetIsInvisible, FSpSetIsInvisible, FSpClearIsInvisible
  1831. */
  1832.  
  1833. /*****************************************************************************/
  1834.  
  1835. pascal    OSErr    FSpClearIsInvisible(const FSSpec *spec);
  1836. /*    ¶ Clear the invisible Finder Flag bit.
  1837.     The FSpClearIsInvisible function clears the invisible bit in the fdFlags
  1838.     word of the specified file or directory's finder information.
  1839.     
  1840.     spec    input:    An FSSpec record specifying the object.
  1841.     
  1842.     Result Codes
  1843.         noErr                0        No error
  1844.         nsvErr                -35        No such volume
  1845.         ioErr                -36        I/O error
  1846.         bdNamErr            -37        Bad filename
  1847.         fnfErr                -43        File not found
  1848.         fLckdErr            -45        File is locked
  1849.         vLckdErr            -46        Volume is locked or read-only
  1850.         paramErr            -50        No default volume
  1851.         dirNFErr            -120    Directory not found or incomplete pathname
  1852.         afpAccessDenied        -5000    User does not have the correct access
  1853.         afpObjectTypeErr    -5025    Directory not found or incomplete pathname
  1854.     
  1855.     __________
  1856.     
  1857.     See also:    SetIsInvisible, FSpSetIsInvisible, ClearIsInvisible
  1858. */
  1859.  
  1860. /*****************************************************************************/
  1861.  
  1862. pascal    OSErr    SetNameLocked(short vRefNum,
  1863.                               long dirID,
  1864.                               ConstStr255Param name);
  1865. /*    ¶ Set the nameLocked Finder Flag bit.
  1866.     The SetNameLocked function sets the nameLocked bit in the fdFlags word
  1867.     of the specified file or directory's finder information.
  1868.     
  1869.     vRefNum    input:    Volume specification.
  1870.     dirID    input:    Directory ID.
  1871.     name    input:    Pointer to object name, or nil when dirID specifies
  1872.                     a directory that's the object.
  1873.     
  1874.     Result Codes
  1875.         noErr                0        No error
  1876.         nsvErr                -35        No such volume
  1877.         ioErr                -36        I/O error
  1878.         bdNamErr            -37        Bad filename
  1879.         fnfErr                -43        File not found
  1880.         fLckdErr            -45        File is locked
  1881.         vLckdErr            -46        Volume is locked or read-only
  1882.         paramErr            -50        No default volume
  1883.         dirNFErr            -120    Directory not found or incomplete pathname
  1884.         afpAccessDenied        -5000    User does not have the correct access
  1885.         afpObjectTypeErr    -5025    Directory not found or incomplete pathname
  1886.     
  1887.     __________
  1888.     
  1889.     See also:    FSpSetNameLocked, ClearNameLocked, FSpClearNameLocked
  1890. */
  1891.  
  1892. /*****************************************************************************/
  1893.  
  1894. pascal    OSErr    FSpSetNameLocked(const FSSpec *spec);
  1895. /*    ¶ Set the nameLocked Finder Flag bit.
  1896.     The FSpSetNameLocked function sets the nameLocked bit in the fdFlags word
  1897.     of the specified file or directory's finder information.
  1898.     
  1899.     spec    input:    An FSSpec record specifying the object.
  1900.     
  1901.     Result Codes
  1902.         noErr                0        No error
  1903.         nsvErr                -35        No such volume
  1904.         ioErr                -36        I/O error
  1905.         bdNamErr            -37        Bad filename
  1906.         fnfErr                -43        File not found
  1907.         fLckdErr            -45        File is locked
  1908.         vLckdErr            -46        Volume is locked or read-only
  1909.         paramErr            -50        No default volume
  1910.         dirNFErr            -120    Directory not found or incomplete pathname
  1911.         afpAccessDenied        -5000    User does not have the correct access
  1912.         afpObjectTypeErr    -5025    Directory not found or incomplete pathname
  1913.     
  1914.     __________
  1915.     
  1916.     See also:    SetNameLocked, ClearNameLocked, FSpClearNameLocked
  1917. */
  1918.  
  1919. /*****************************************************************************/
  1920.  
  1921. pascal    OSErr    ClearNameLocked(short vRefNum,
  1922.                                 long dirID,
  1923.                                 ConstStr255Param name);
  1924. /*    ¶ Clear the nameLocked Finder Flag bit.
  1925.     The ClearNameLocked function clears the nameLocked bit in the fdFlags
  1926.     word of the specified file or directory's finder information.
  1927.     
  1928.     vRefNum    input:    Volume specification.
  1929.     dirID    input:    Directory ID.
  1930.     name    input:    Pointer to object name, or nil when dirID specifies
  1931.                     a directory that's the object.
  1932.     
  1933.     Result Codes
  1934.         noErr                0        No error
  1935.         nsvErr                -35        No such volume
  1936.         ioErr                -36        I/O error
  1937.         bdNamErr            -37        Bad filename
  1938.         fnfErr                -43        File not found
  1939.         fLckdErr            -45        File is locked
  1940.         vLckdErr            -46        Volume is locked or read-only
  1941.         paramErr            -50        No default volume
  1942.         dirNFErr            -120    Directory not found or incomplete pathname
  1943.         afpAccessDenied        -5000    User does not have the correct access
  1944.         afpObjectTypeErr    -5025    Directory not found or incomplete pathname
  1945.     
  1946.     __________
  1947.     
  1948.     See also:    SetNameLocked, FSpSetNameLocked, FSpClearNameLocked
  1949. */
  1950.  
  1951. /*****************************************************************************/
  1952.  
  1953. pascal    OSErr    FSpClearNameLocked(const FSSpec *spec);
  1954. /*    ¶ Clear the nameLocked Finder Flag bit.
  1955.     The FSpClearNameLocked function clears the nameLocked bit in the fdFlags
  1956.     word of the specified file or directory's finder information.
  1957.     
  1958.     spec    input:    An FSSpec record specifying the object.
  1959.     
  1960.     Result Codes
  1961.         noErr                0        No error
  1962.         nsvErr                -35        No such volume
  1963.         ioErr                -36        I/O error
  1964.         bdNamErr            -37        Bad filename
  1965.         fnfErr                -43        File not found
  1966.         fLckdErr            -45        File is locked
  1967.         vLckdErr            -46        Volume is locked or read-only
  1968.         paramErr            -50        No default volume
  1969.         dirNFErr            -120    Directory not found or incomplete pathname
  1970.         afpAccessDenied        -5000    User does not have the correct access
  1971.         afpObjectTypeErr    -5025    Directory not found or incomplete pathname
  1972.     
  1973.     __________
  1974.     
  1975.     See also:    SetNameLocked, FSpSetNameLocked, ClearNameLocked
  1976. */
  1977.  
  1978. /*****************************************************************************/
  1979.  
  1980. pascal    OSErr    SetIsStationery(short vRefNum,
  1981.                                 long dirID,
  1982.                                 ConstStr255Param name);
  1983. /*    ¶ Set the isStationery Finder Flag bit.
  1984.     The SetIsStationery function sets the isStationery bit in the
  1985.     fdFlags word of the specified file or directory's finder information.
  1986.     
  1987.     vRefNum    input:    Volume specification.
  1988.     dirID    input:    Directory ID.
  1989.     name    input:    Pointer to object name, or nil when dirID specifies
  1990.                     a directory that's the object.
  1991.     
  1992.     Result Codes
  1993.         noErr                0        No error
  1994.         nsvErr                -35        No such volume
  1995.         ioErr                -36        I/O error
  1996.         bdNamErr            -37        Bad filename
  1997.         fnfErr                -43        File not found
  1998.         fLckdErr            -45        File is locked
  1999.         vLckdErr            -46        Volume is locked or read-only
  2000.         paramErr            -50        No default volume
  2001.         dirNFErr            -120    Directory not found or incomplete pathname
  2002.         afpAccessDenied        -5000    User does not have the correct access
  2003.         afpObjectTypeErr    -5025    Directory not found or incomplete pathname
  2004.     
  2005.     __________
  2006.     
  2007.     See also:    FSpSetIsStationery, ClearIsStationery, FSpClearIsStationery
  2008. */
  2009.  
  2010. /*****************************************************************************/
  2011.  
  2012. pascal    OSErr    FSpSetIsStationery(const FSSpec *spec);
  2013. /*    ¶ Set the isStationery Finder Flag bit.
  2014.     The FSpSetIsStationery function sets the isStationery bit in the
  2015.     fdFlags word of the specified file or directory's finder information.
  2016.     
  2017.     spec    input:    An FSSpec record specifying the object.
  2018.     
  2019.     Result Codes
  2020.         noErr                0        No error
  2021.         nsvErr                -35        No such volume
  2022.         ioErr                -36        I/O error
  2023.         bdNamErr            -37        Bad filename
  2024.         fnfErr                -43        File not found
  2025.         fLckdErr            -45        File is locked
  2026.         vLckdErr            -46        Volume is locked or read-only
  2027.         paramErr            -50        No default volume
  2028.         dirNFErr            -120    Directory not found or incomplete pathname
  2029.         afpAccessDenied        -5000    User does not have the correct access
  2030.         afpObjectTypeErr    -5025    Directory not found or incomplete pathname
  2031.     
  2032.     __________
  2033.     
  2034.     See also:    SetIsStationery, ClearIsStationery, FSpClearIsStationery
  2035. */
  2036.  
  2037. /*****************************************************************************/
  2038.  
  2039. pascal    OSErr    ClearIsStationery(short vRefNum,
  2040.                                   long dirID,
  2041.                                   ConstStr255Param name);
  2042. /*    ¶ Clear the isStationery Finder Flag bit.
  2043.     The ClearIsStationery function clears the isStationery bit in the
  2044.     fdFlags word of the specified file or directory's finder information.
  2045.     
  2046.     vRefNum    input:    Volume specification.
  2047.     dirID    input:    Directory ID.
  2048.     name    input:    Pointer to object name, or nil when dirID specifies
  2049.                     a directory that's the object.
  2050.     
  2051.     Result Codes
  2052.         noErr                0        No error
  2053.         nsvErr                -35        No such volume
  2054.         ioErr                -36        I/O error
  2055.         bdNamErr            -37        Bad filename
  2056.         fnfErr                -43        File not found
  2057.         fLckdErr            -45        File is locked
  2058.         vLckdErr            -46        Volume is locked or read-only
  2059.         paramErr            -50        No default volume
  2060.         dirNFErr            -120    Directory not found or incomplete pathname
  2061.         afpAccessDenied        -5000    User does not have the correct access
  2062.         afpObjectTypeErr    -5025    Directory not found or incomplete pathname
  2063.     
  2064.     __________
  2065.     
  2066.     See also:    SetIsStationery, FSpSetIsStationery, FSpClearIsStationery
  2067. */
  2068.  
  2069. /*****************************************************************************/
  2070.  
  2071. pascal    OSErr    FSpClearIsStationery(const FSSpec *spec);
  2072. /*    ¶ Clear the isStationery Finder Flag bit.
  2073.     The FSpClearIsStationery function clears the isStationery bit in the
  2074.     fdFlags word of the specified file or directory's finder information.
  2075.     
  2076.     spec    input:    An FSSpec record specifying the object.
  2077.     
  2078.     Result Codes
  2079.         noErr                0        No error
  2080.         nsvErr                -35        No such volume
  2081.         ioErr                -36        I/O error
  2082.         bdNamErr            -37        Bad filename
  2083.         fnfErr                -43        File not found
  2084.         fLckdErr            -45        File is locked
  2085.         vLckdErr            -46        Volume is locked or read-only
  2086.         paramErr            -50        No default volume
  2087.         dirNFErr            -120    Directory not found or incomplete pathname
  2088.         afpAccessDenied        -5000    User does not have the correct access
  2089.         afpObjectTypeErr    -5025    Directory not found or incomplete pathname
  2090.     
  2091.     __________
  2092.     
  2093.     See also:    SetIsStationery, FSpSetIsStationery, ClearIsStationery
  2094. */
  2095.  
  2096. /*****************************************************************************/
  2097.  
  2098. pascal    OSErr    SetHasCustomIcon(short vRefNum,
  2099.                                  long dirID,
  2100.                                  ConstStr255Param name);
  2101. /*    ¶ Set the hasCustomIcon Finder Flag bit.
  2102.     The SetHasCustomIcon function sets the hasCustomIcon bit in the
  2103.     fdFlags word of the specified file or directory's finder information.
  2104.     
  2105.     vRefNum    input:    Volume specification.
  2106.     dirID    input:    Directory ID.
  2107.     name    input:    Pointer to object name, or nil when dirID specifies
  2108.                     a directory that's the object.
  2109.     
  2110.     Result Codes
  2111.         noErr                0        No error
  2112.         nsvErr                -35        No such volume
  2113.         ioErr                -36        I/O error
  2114.         bdNamErr            -37        Bad filename
  2115.         fnfErr                -43        File not found
  2116.         fLckdErr            -45        File is locked
  2117.         vLckdErr            -46        Volume is locked or read-only
  2118.         paramErr            -50        No default volume
  2119.         dirNFErr            -120    Directory not found or incomplete pathname
  2120.         afpAccessDenied        -5000    User does not have the correct access
  2121.         afpObjectTypeErr    -5025    Directory not found or incomplete pathname
  2122.     
  2123.     __________
  2124.     
  2125.     See also:    FSpSetHasCustomIcon, ClearHasCustomIcon, FSpClearHasCustomIcon
  2126. */
  2127.  
  2128. /*****************************************************************************/
  2129.  
  2130. pascal    OSErr    FSpSetHasCustomIcon(const FSSpec *spec);
  2131. /*    ¶ Set the hasCustomIcon Finder Flag bit.
  2132.     The FSpSetHasCustomIcon function sets the hasCustomIcon bit in the
  2133.     fdFlags word of the specified file or directory's finder information.
  2134.     
  2135.     spec    input:    An FSSpec record specifying the object.
  2136.     
  2137.     Result Codes
  2138.         noErr                0        No error
  2139.         nsvErr                -35        No such volume
  2140.         ioErr                -36        I/O error
  2141.         bdNamErr            -37        Bad filename
  2142.         fnfErr                -43        File not found
  2143.         fLckdErr            -45        File is locked
  2144.         vLckdErr            -46        Volume is locked or read-only
  2145.         paramErr            -50        No default volume
  2146.         dirNFErr            -120    Directory not found or incomplete pathname
  2147.         afpAccessDenied        -5000    User does not have the correct access
  2148.         afpObjectTypeErr    -5025    Directory not found or incomplete pathname
  2149.     
  2150.     __________
  2151.     
  2152.     See also:    SetHasCustomIcon, ClearHasCustomIcon, FSpClearHasCustomIcon
  2153. */
  2154.  
  2155. /*****************************************************************************/
  2156.  
  2157. pascal    OSErr    ClearHasCustomIcon(short vRefNum,
  2158.                                    long dirID,
  2159.                                    ConstStr255Param name);
  2160. /*    ¶ Clear the hasCustomIcon Finder Flag bit.
  2161.     The ClearHasCustomIcon function clears the hasCustomIcon bit in the
  2162.     fdFlags word of the specified file or directory's finder information.
  2163.     
  2164.     vRefNum    input:    Volume specification.
  2165.     dirID    input:    Directory ID.
  2166.     name    input:    Pointer to object name, or nil when dirID specifies
  2167.                     a directory that's the object.
  2168.     
  2169.     Result Codes
  2170.         noErr                0        No error
  2171.         nsvErr                -35        No such volume
  2172.         ioErr                -36        I/O error
  2173.         bdNamErr            -37        Bad filename
  2174.         fnfErr                -43        File not found
  2175.         fLckdErr            -45        File is locked
  2176.         vLckdErr            -46        Volume is locked or read-only
  2177.         paramErr            -50        No default volume
  2178.         dirNFErr            -120    Directory not found or incomplete pathname
  2179.         afpAccessDenied        -5000    User does not have the correct access
  2180.         afpObjectTypeErr    -5025    Directory not found or incomplete pathname
  2181.     
  2182.     __________
  2183.     
  2184.     See also:    SetHasCustomIcon, FSpSetHasCustomIcon, FSpClearHasCustomIcon
  2185. */
  2186.  
  2187. /*****************************************************************************/
  2188.  
  2189. pascal    OSErr    FSpClearHasCustomIcon(const FSSpec *spec);
  2190. /*    ¶ Clear the hasCustomIcon Finder Flag bit.
  2191.     The FSpClearHasCustomIcon function clears the hasCustomIcon bit in the
  2192.     fdFlags word of the specified file or directory's finder information.
  2193.     
  2194.     spec    input:    An FSSpec record specifying the object.
  2195.     
  2196.     Result Codes
  2197.         noErr                0        No error
  2198.         nsvErr                -35        No such volume
  2199.         ioErr                -36        I/O error
  2200.         bdNamErr            -37        Bad filename
  2201.         fnfErr                -43        File not found
  2202.         fLckdErr            -45        File is locked
  2203.         vLckdErr            -46        Volume is locked or read-only
  2204.         paramErr            -50        No default volume
  2205.         dirNFErr            -120    Directory not found or incomplete pathname
  2206.         afpAccessDenied        -5000    User does not have the correct access
  2207.         afpObjectTypeErr    -5025    Directory not found or incomplete pathname
  2208.     
  2209.     __________
  2210.     
  2211.     See also:    SetHasCustomIcon, FSpSetHasCustomIcon, ClearHasCustomIcon
  2212. */
  2213.  
  2214. /*****************************************************************************/
  2215.  
  2216. pascal    OSErr    ClearHasBeenInited(short vRefNum,
  2217.                                    long dirID,
  2218.                                    ConstStr255Param name);
  2219. /*    ¶ Clear the hasBeenInited Finder Flag bit.
  2220.     The ClearHasBeenInited function clears the hasBeenInited bit in the
  2221.     fdFlags word of the specified file or directory's finder information.
  2222.     
  2223.     vRefNum    input:    Volume specification.
  2224.     dirID    input:    Directory ID.
  2225.     name    input:    Pointer to object name, or nil when dirID specifies
  2226.                     a directory that's the object.
  2227.     
  2228.     Result Codes
  2229.         noErr                0        No error
  2230.         nsvErr                -35        No such volume
  2231.         ioErr                -36        I/O error
  2232.         bdNamErr            -37        Bad filename
  2233.         fnfErr                -43        File not found
  2234.         fLckdErr            -45        File is locked
  2235.         vLckdErr            -46        Volume is locked or read-only
  2236.         paramErr            -50        No default volume
  2237.         dirNFErr            -120    Directory not found or incomplete pathname
  2238.         afpAccessDenied        -5000    User does not have the correct access
  2239.         afpObjectTypeErr    -5025    Directory not found or incomplete pathname
  2240.     
  2241.     __________
  2242.     
  2243.     See also:    FSpClearHasBeenInited
  2244. */
  2245.  
  2246. /*****************************************************************************/
  2247.  
  2248. pascal    OSErr    FSpClearHasBeenInited(const FSSpec *spec);
  2249. /*    ¶ Clear the hasBeenInited Finder Flag bit.
  2250.     The FSpClearHasBeenInited function clears the hasBeenInited bit in the
  2251.     fdFlags word of the specified file or directory's finder information.
  2252.     
  2253.     spec    input:    An FSSpec record specifying the object.
  2254.     
  2255.     Result Codes
  2256.         noErr                0        No error
  2257.         nsvErr                -35        No such volume
  2258.         ioErr                -36        I/O error
  2259.         bdNamErr            -37        Bad filename
  2260.         fnfErr                -43        File not found
  2261.         fLckdErr            -45        File is locked
  2262.         vLckdErr            -46        Volume is locked or read-only
  2263.         paramErr            -50        No default volume
  2264.         dirNFErr            -120    Directory not found or incomplete pathname
  2265.         afpAccessDenied        -5000    User does not have the correct access
  2266.         afpObjectTypeErr    -5025    Directory not found or incomplete pathname
  2267.     
  2268.     __________
  2269.     
  2270.     See also:    ClearHasBeenInited
  2271. */
  2272.  
  2273. /*****************************************************************************/
  2274.  
  2275. pascal    OSErr    CopyFileMgrAttributes(short srcVRefNum,
  2276.                                       long srcDirID,
  2277.                                       ConstStr255Param srcName,
  2278.                                       short dstVRefNum,
  2279.                                       long dstDirID,
  2280.                                       ConstStr255Param dstName,
  2281.                                       Boolean copyLockBit);
  2282. /*    ¶ Copy all File Manager attributes from the source to the destination.
  2283.     The CopyFileMgrAttributes function copies all File Manager attributes
  2284.     from the source file or directory to the destination file or directory.
  2285.     If copyLockBit is true, then set the locked state of the destination
  2286.     to match the source.
  2287.  
  2288.     srcVRefNum    input:    Source volume specification.
  2289.     srcDirID    input:    Source directory ID.
  2290.     srcName        input:    Pointer to source object name, or nil when
  2291.                         srcDirID specifies a directory that's the object.
  2292.     dstVRefNum    input:    Destination volume specification.
  2293.     dstDirID    input:    Destination directory ID.
  2294.     dstName        input:    Pointer to destination object name, or nil when
  2295.                         dstDirID specifies a directory that's the object.
  2296.     copyLockBit    input:    If true, set the locked state of the destination
  2297.                         to match the source.
  2298.     
  2299.     Result Codes
  2300.         noErr                0        No error
  2301.         nsvErr                -35        No such volume
  2302.         ioErr                -36        I/O error
  2303.         bdNamErr            -37        Bad filename
  2304.         fnfErr                -43        File not found
  2305.         fLckdErr            -45        File is locked
  2306.         vLckdErr            -46        Volume is locked or read-only
  2307.         paramErr            -50        No default volume
  2308.         dirNFErr            -120    Directory not found or incomplete pathname
  2309.         afpAccessDenied        -5000    User does not have the correct access
  2310.         afpObjectTypeErr    -5025    Directory not found or incomplete pathname
  2311.     
  2312.     __________
  2313.     
  2314.     See also:    FSpCopyFileMgrAttributes
  2315. */
  2316.  
  2317. /*****************************************************************************/
  2318.  
  2319. pascal    OSErr    FSpCopyFileMgrAttributes(const FSSpec *srcSpec,
  2320.                                          const FSSpec *dstSpec,
  2321.                                          Boolean copyLockBit);
  2322. /*    ¶ Copy all File Manager attributes from the source to the destination.
  2323.     The FSpCopyFileMgrAttributes function copies all File Manager attributes
  2324.     from the source file or directory to the destination file or directory.
  2325.     If copyLockBit is true, then set the locked state of the destination
  2326.     to match the source.
  2327.  
  2328.     srcSpec        input:    An FSSpec record specifying the source object.
  2329.     dstSpec        input:    An FSSpec record specifying the destination object.
  2330.     copyLockBit    input:    If true, set the locked state of the destination
  2331.                         to match the source.
  2332.     
  2333.     Result Codes
  2334.         noErr                0        No error
  2335.         nsvErr                -35        No such volume
  2336.         ioErr                -36        I/O error
  2337.         bdNamErr            -37        Bad filename
  2338.         fnfErr                -43        File not found
  2339.         fLckdErr            -45        File is locked
  2340.         vLckdErr            -46        Volume is locked or read-only
  2341.         paramErr            -50        No default volume
  2342.         dirNFErr            -120    Directory not found or incomplete pathname
  2343.         afpAccessDenied        -5000    User does not have the correct access
  2344.         afpObjectTypeErr    -5025    Directory not found or incomplete pathname
  2345.     
  2346.     __________
  2347.     
  2348.     See also:    CopyFileMgrAttributes
  2349. */
  2350.  
  2351. /*****************************************************************************/
  2352.  
  2353. pascal    OSErr    HOpenAware(short vRefNum,
  2354.                            long dirID,
  2355.                            ConstStr255Param fileName,
  2356.                            short denyModes,
  2357.                            short *refNum);
  2358. /*    ¶ Open the data fork of a file using deny mode permissions.
  2359.     The HOpenAware function opens the data fork of a file using deny mode
  2360.     permissions instead the normal File Manager permissions.  If OpenDeny
  2361.     is not available, then HOpenAware translates the deny modes to the
  2362.     closest File Manager permissions and tries to open the file with
  2363.     OpenDF first, and then Open if OpenDF isn't available. By using
  2364.     HOpenAware with deny mode permissions, a program can be "AppleShare
  2365.     aware" and fall back on the standard File Manager open calls
  2366.     automatically.
  2367.  
  2368.     vRefNum        input:    Volume specification.
  2369.     dirID        input:    Directory ID.
  2370.     fileName    input:    The name of the file.
  2371.     denyModes    input:    The deny modes access under which to open the file.
  2372.     refNum        output:    The file reference number of the opened file.
  2373.     
  2374.     Result Codes
  2375.         noErr                0        No error
  2376.         nsvErr                -35        No such volume
  2377.         tmfoErr                -42        Too many files open
  2378.         fnfErr                -43        File not found
  2379.         wPrErr                -44        Volume locked by hardware
  2380.         fLckdErr            -45        File is locked
  2381.         vLckdErr            -46        Volume is locked or read-only
  2382.         opWrErr                -49        File already open for writing
  2383.         paramErr            -50        No default volume
  2384.         permErr                 -54        File is already open and cannot be opened using specified deny modes
  2385.         afpAccessDenied        -5000    User does not have the correct access to the file
  2386.         afpDenyConflict        -5006    Requested access permission not possible
  2387.     
  2388.     __________
  2389.     
  2390.     See also:    FSpOpenAware, HOpenRFAware, FSpOpenRFAware
  2391. */
  2392.  
  2393. /*****************************************************************************/
  2394.  
  2395. pascal    OSErr    FSpOpenAware(const FSSpec *spec,
  2396.                              short denyModes,
  2397.                              short *refNum);
  2398. /*    ¶ Open the data fork of a file using deny mode permissions.
  2399.     The FSpOpenAware function opens the data fork of a file using deny mode
  2400.     permissions instead the normal File Manager permissions.  If OpenDeny
  2401.     is not available, then FSpOpenAware translates the deny modes to the
  2402.     closest File Manager permissions and tries to open the file with
  2403.     OpenDF first, and then Open if OpenDF isn't available. By using
  2404.     FSpOpenAware with deny mode permissions, a program can be "AppleShare
  2405.     aware" and fall back on the standard File Manager open calls
  2406.     automatically.
  2407.  
  2408.     spec        input:    An FSSpec record specifying the file.
  2409.     denyModes    input:    The deny modes access under which to open the file.
  2410.     refNum        output:    The file reference number of the opened file.
  2411.     
  2412.     Result Codes
  2413.         noErr                0        No error
  2414.         nsvErr                -35        No such volume
  2415.         tmfoErr                -42        Too many files open
  2416.         fnfErr                -43        File not found
  2417.         wPrErr                -44        Volume locked by hardware
  2418.         fLckdErr            -45        File is locked
  2419.         vLckdErr            -46        Volume is locked or read-only
  2420.         opWrErr                -49        File already open for writing
  2421.         paramErr            -50        No default volume
  2422.         permErr                 -54        File is already open and cannot be opened using specified deny modes
  2423.         afpAccessDenied        -5000    User does not have the correct access to the file
  2424.         afpDenyConflict        -5006    Requested access permission not possible
  2425.     
  2426.     __________
  2427.     
  2428.     See also:    HOpenAware, HOpenRFAware, FSpOpenRFAware
  2429. */
  2430.  
  2431. /*****************************************************************************/
  2432.  
  2433. pascal    OSErr    HOpenRFAware(short vRefNum,
  2434.                              long dirID,
  2435.                              ConstStr255Param fileName,
  2436.                              short denyModes,
  2437.                              short *refNum);
  2438. /*    ¶ Open the resource fork of a file using deny mode permissions.
  2439.     The HOpenRFAware function opens the resource fork of a file using deny
  2440.     mode permissions instead the normal File Manager permissions.  If
  2441.     OpenRFDeny is not available, then HOpenRFAware translates the deny
  2442.     modes to the closest File Manager permissions and tries to open the
  2443.     file with OpenRF. By using HOpenRFAware with deny mode permissions,
  2444.     a program can be "AppleShare aware" and fall back on the standard
  2445.     File Manager open calls automatically.
  2446.  
  2447.     vRefNum        input:    Volume specification.
  2448.     dirID        input:    Directory ID.
  2449.     fileName    input:    The name of the file.
  2450.     denyModes    input:    The deny modes access under which to open the file.
  2451.     refNum        output:    The file reference number of the opened file.
  2452.     
  2453.     Result Codes
  2454.         noErr                0        No error
  2455.         nsvErr                -35        No such volume
  2456.         tmfoErr                -42        Too many files open
  2457.         fnfErr                -43        File not found
  2458.         wPrErr                -44        Volume locked by hardware
  2459.         fLckdErr            -45        File is locked
  2460.         vLckdErr            -46        Volume is locked or read-only
  2461.         opWrErr                -49        File already open for writing
  2462.         paramErr            -50        No default volume
  2463.         permErr                 -54        File is already open and cannot be opened using specified deny modes
  2464.         afpAccessDenied        -5000    User does not have the correct access to the file
  2465.         afpDenyConflict        -5006    Requested access permission not possible
  2466.     
  2467.     __________
  2468.     
  2469.     See also:    HOpenAware, FSpOpenAware, FSpOpenRFAware
  2470. */
  2471.  
  2472. /*****************************************************************************/
  2473.  
  2474. pascal    OSErr    FSpOpenRFAware(const FSSpec *spec,
  2475.                                short denyModes,
  2476.                                short *refNum);
  2477. /*    ¶ Open the resource fork of a file using deny mode permissions.
  2478.     The FSpOpenRFAware function opens the resource fork of a file using deny
  2479.     mode permissions instead the normal File Manager permissions.  If
  2480.     OpenRFDeny is not available, then FSpOpenRFAware translates the deny
  2481.     modes to the closest File Manager permissions and tries to open the
  2482.     file with OpenRF. By using FSpOpenRFAware with deny mode permissions,
  2483.     a program can be "AppleShare aware" and fall back on the standard
  2484.     File Manager open calls automatically.
  2485.  
  2486.     spec        input:    An FSSpec record specifying the file.
  2487.     denyModes    input:    The deny modes access under which to open the file.
  2488.     refNum        output:    The file reference number of the opened file.
  2489.     
  2490.     Result Codes
  2491.         noErr                0        No error
  2492.         nsvErr                -35        No such volume
  2493.         tmfoErr                -42        Too many files open
  2494.         fnfErr                -43        File not found
  2495.         wPrErr                -44        Volume locked by hardware
  2496.         fLckdErr            -45        File is locked
  2497.         vLckdErr            -46        Volume is locked or read-only
  2498.         opWrErr                -49        File already open for writing
  2499.         paramErr            -50        No default volume
  2500.         permErr                 -54        File is already open and cannot be opened using specified deny modes
  2501.         afpAccessDenied        -5000    User does not have the correct access to the file
  2502.         afpDenyConflict        -5006    Requested access permission not possible
  2503.     
  2504.     __________
  2505.     
  2506.     See also:    HOpenAware, FSpOpenAware, HOpenRFAware
  2507. */
  2508.  
  2509. /*****************************************************************************/
  2510.  
  2511. pascal    OSErr    FSReadNoCache(short refNum,
  2512.                               long *count,
  2513.                               void *buffPtr);
  2514. /*    ¶ Read any number of bytes from an open file requesting no caching.
  2515.     The FSReadNoCache function reads any number of bytes from an open file
  2516.     while asking the file system to bypass its cache mechanism.
  2517.     
  2518.     refNum    input:    The file reference number of an open file.
  2519.     count    input:    The number of bytes to read.
  2520.             output:    The number of bytes actually read.
  2521.     buffPtr    input:    A pointer to the data buffer into which the bytes are
  2522.                     to be read.
  2523.     
  2524.     Result Codes
  2525.         noErr                0        No error
  2526.         readErr                –19        Driver does not respond to read requests
  2527.         badUnitErr            –21        Driver reference number does not
  2528.                                     match unit table
  2529.         unitEmptyErr        –22        Driver reference number specifies a
  2530.                                     nil handle in unit table
  2531.         abortErr            –27        Request aborted by KillIO
  2532.         notOpenErr            –28        Driver not open
  2533.         ioErr                –36        Data does not match in read-verify mode
  2534.         fnOpnErr            -38        File not open
  2535.         rfNumErr            -51        Bad reference number
  2536.         afpAccessDenied        -5000    User does not have the correct access to
  2537.                                     the file
  2538.  
  2539.     __________
  2540.     
  2541.     See also:    FSWriteNoCache
  2542. */
  2543.  
  2544. /*****************************************************************************/
  2545.  
  2546. pascal    OSErr    FSWriteNoCache(short refNum,
  2547.                                long *count,
  2548.                                const void *buffPtr);
  2549. /*    ¶ Write any number of bytes to an open file requesting no caching.
  2550.     The FSReadNoCache function writes any number of bytes to an open file
  2551.     while asking the file system to bypass its cache mechanism.
  2552.     
  2553.     refNum    input:    The file reference number of an open file.
  2554.     count    input:    The number of bytes to write to the file.
  2555.             output:    The number of bytes actually written.
  2556.     buffPtr    input:    A pointer to the data buffer from which the bytes are
  2557.                     to be written.
  2558.     
  2559.     Result Codes
  2560.         noErr                0        No error
  2561.         writErr                –20        Driver does not respond to write requests
  2562.         badUnitErr            –21        Driver reference number does not
  2563.                                     match unit table
  2564.         unitEmptyErr        –22        Driver reference number specifies a
  2565.                                     nil handle in unit table
  2566.         abortErr            –27        Request aborted by KillIO
  2567.         notOpenErr            –28        Driver not open
  2568.         dskFulErr            -34        Disk full    
  2569.         ioErr                –36        Data does not match in read-verify mode
  2570.         fnOpnErr            -38        File not open
  2571.         wPrErr                -44        Hardware volume lock    
  2572.         fLckdErr            -45        File is locked    
  2573.         vLckdErr            -46        Software volume lock    
  2574.         rfNumErr            -51        Bad reference number
  2575.         wrPermErr            -61        Read/write permission doesn’t
  2576.                                     allow writing    
  2577.         afpAccessDenied        -5000    User does not have the correct access to
  2578.                                     the file
  2579.  
  2580.     __________
  2581.     
  2582.     See also:    FSReadNoCache
  2583. */
  2584.  
  2585. /*****************************************************************************/
  2586.  
  2587. pascal    OSErr    FSWriteVerify(short refNum,
  2588.                               long *count,
  2589.                               const void *buffPtr);
  2590. /*    ¶ Write any number of bytes to an open file and then verify the data was written.
  2591.     The FSWriteVerify function writes any number of bytes to an open file
  2592.     and then verifies that the data was actually written to the device.
  2593.     
  2594.     refNum    input:    The file reference number of an open file.
  2595.     count    input:    The number of bytes to write to the file.
  2596.             output:    The number of bytes actually written and verified.
  2597.     buffPtr    input:    A pointer to the data buffer from which the bytes are
  2598.                     to be written.
  2599.     
  2600.     Result Codes
  2601.         noErr                0        No error
  2602.         readErr                –19        Driver does not respond to read requests
  2603.         writErr                –20        Driver does not respond to write requests
  2604.         badUnitErr            –21        Driver reference number does not
  2605.                                     match unit table
  2606.         unitEmptyErr        –22        Driver reference number specifies a
  2607.                                     nil handle in unit table
  2608.         abortErr            –27        Request aborted by KillIO
  2609.         notOpenErr            –28        Driver not open
  2610.         dskFulErr            -34        Disk full    
  2611.         ioErr                –36        Data does not match in read-verify mode
  2612.         fnOpnErr            -38        File not open
  2613.         eofErr                -39        Logical end-of-file reached
  2614.         posErr                -40        Attempt to position mark before start
  2615.                                     of file
  2616.         wPrErr                -44        Hardware volume lock    
  2617.         fLckdErr            -45        File is locked    
  2618.         vLckdErr            -46        Software volume lock    
  2619.         rfNumErr            -51        Bad reference number
  2620.         gfpErr                -52        Error during GetFPos
  2621.         wrPermErr            -61        Read/write permission doesn’t
  2622.                                     allow writing    
  2623.         memFullErr            -108    Not enough room in heap zone to allocate
  2624.                                     verify buffer
  2625.         afpAccessDenied        -5000    User does not have the correct access to
  2626.                                     the file
  2627. */
  2628.  
  2629. /*****************************************************************************/
  2630.  
  2631. pascal    OSErr    CopyFork(short srcRefNum,
  2632.                          short dstRefNum,
  2633.                          void *copyBufferPtr,
  2634.                          long copyBufferSize);
  2635. /*    ¶ Copy all data from the source fork to the destination fork of open file forks.
  2636.     The CopyFork function copies all data from the source fork to the
  2637.     destination fork of open file forks and makes sure the destination EOF
  2638.     is equal to the source EOF.
  2639.     
  2640.     srcRefNum        input:    The source file reference number.
  2641.     dstRefNum        input:    The destination file reference number.
  2642.     copyBufferPtr    input:    Pointer to buffer to use during copy. The
  2643.                             buffer should be at least 512-bytes minimum.
  2644.                             The larger the buffer, the faster the copy.
  2645.     copyBufferSize    input:    The size of the copy buffer.
  2646.     
  2647.     Result Codes
  2648.         noErr                0        No error
  2649.         readErr                –19        Driver does not respond to read requests
  2650.         writErr                –20        Driver does not respond to write requests
  2651.         badUnitErr            –21        Driver reference number does not
  2652.                                     match unit table
  2653.         unitEmptyErr        –22        Driver reference number specifies a
  2654.                                     nil handle in unit table
  2655.         abortErr            –27        Request aborted by KillIO
  2656.         notOpenErr            –28        Driver not open
  2657.         dskFulErr            -34        Disk full    
  2658.         ioErr                –36        Data does not match in read-verify mode
  2659.         fnOpnErr            -38        File not open
  2660.         wPrErr                -44        Hardware volume lock    
  2661.         fLckdErr            -45        File is locked    
  2662.         vLckdErr            -46        Software volume lock    
  2663.         rfNumErr            -51        Bad reference number
  2664.         wrPermErr            -61        Read/write permission doesn’t
  2665.                                     allow writing    
  2666.         afpAccessDenied        -5000    User does not have the correct access to
  2667.                                     the file
  2668. */
  2669.  
  2670. /*****************************************************************************/
  2671.  
  2672. pascal    OSErr    GetFileLocation(short refNum,
  2673.                                 short *vRefNum,
  2674.                                 long *dirID,
  2675.                                 StringPtr fileName);
  2676. /*    ¶ Get the location of an open file.
  2677.     The GetFileLocation function gets the location (volume reference number,
  2678.     directory ID, and fileName) of an open file.
  2679.  
  2680.     refNum        input:    The file reference number of an open file.
  2681.     vRefNum        output:    The volume reference number.
  2682.     dirID        output:    The parent directory ID.
  2683.     fileName    input:    Points to a buffer (minimum Str63) where the
  2684.                         filename is to be returned or must be nil.
  2685.                 output:    The filename.
  2686.     
  2687.     Result Codes
  2688.         noErr                0        No error
  2689.         nsvErr                -35        Specified volume doesn’t exist
  2690.         fnOpnErr            -38        File not open
  2691.         rfNumErr            -51        Reference number specifies nonexistent
  2692.                                     access path
  2693.     
  2694.     __________
  2695.     
  2696.     See also:    FSpGetFileLocation
  2697. */
  2698.  
  2699. /*****************************************************************************/
  2700.  
  2701. pascal    OSErr    FSpGetFileLocation(short refNum,
  2702.                                    FSSpec *spec);
  2703. /*    ¶ Get the location of an open file in an FSSpec record.
  2704.     The FSpGetFileLocation function gets the location of an open file in
  2705.     an FSSpec record.
  2706.  
  2707.     refNum        input:    The file reference number of an open file.
  2708.     spec        output:    FSSpec record containing the file name and location.
  2709.     
  2710.     Result Codes
  2711.         noErr                0        No error
  2712.         nsvErr                -35        Specified volume doesn’t exist
  2713.         fnOpnErr            -38        File not open
  2714.         rfNumErr            -51        Reference number specifies nonexistent
  2715.                                     access path
  2716.     
  2717.     __________
  2718.     
  2719.     See also:    GetFileLocation
  2720. */
  2721.  
  2722. /*****************************************************************************/
  2723.  
  2724. pascal    OSErr    CopyDirectoryAccess(short srcVRefNum,
  2725.                                     long srcDirID,
  2726.                                     ConstStr255Param srcName,
  2727.                                     short dstVRefNum,
  2728.                                     long dstDirID,
  2729.                                     ConstStr255Param dstName);
  2730. /*    ¶ Copy the AFP directory access privileges.
  2731.     The CopyDirectoryAccess function copies the AFP directory access
  2732.     privileges from one directory to another. Both directories must be on
  2733.     the same file server, but not necessarily on the same server volume.
  2734.     
  2735.     srcVRefNum    input:    Source volume specification.
  2736.     srcDirID    input:    Source directory ID.
  2737.     srcName        input:    Pointer to source directory name, or nil when
  2738.                         srcDirID specifies the directory.
  2739.     dstVRefNum    input:    Destination volume specification.
  2740.     dstDirID    input:    Destination directory ID.
  2741.     dstName        input:    Pointer to destination directory name, or nil when
  2742.                         dstDirID specifies the directory.
  2743.     
  2744.     Result Codes
  2745.         noErr                0        No error
  2746.         nsvErr                -35        Volume not found
  2747.         fnfErr                -43        Directory not found
  2748.         vLckdErr            -46        Volume is locked or read-only
  2749.         paramErr            -50        Volume doesn't support this function
  2750.         afpAccessDenied        -5000    User does not have the correct access
  2751.                                     to the directory
  2752.         afpObjectTypeErr    -5025    Object is a file, not a directory
  2753.     
  2754.     __________
  2755.     
  2756.     See also:    FSpCopyDirectoryAccess
  2757. */
  2758.  
  2759. /*****************************************************************************/
  2760.  
  2761. pascal    OSErr    FSpCopyDirectoryAccess(const FSSpec *srcSpec,
  2762.                                        const FSSpec *dstSpec);
  2763. /*    ¶ Copy the AFP directory access privileges.
  2764.     The FSpCopyDirectoryAccess function copies the AFP directory access
  2765.     privileges from one directory to another. Both directories must be on
  2766.     the same file server, but not necessarily on the same server volume.
  2767.  
  2768.     srcSpec        input:    An FSSpec record specifying the source directory.
  2769.     dstSpec        input:    An FSSpec record specifying the destination directory.
  2770.     
  2771.     Result Codes
  2772.         noErr                0        No error
  2773.         nsvErr                -35        Volume not found
  2774.         fnfErr                -43        Directory not found
  2775.         vLckdErr            -46        Volume is locked or read-only
  2776.         paramErr            -50        Volume doesn't support this function
  2777.         afpAccessDenied        -5000    User does not have the correct access
  2778.                                     to the directory
  2779.         afpObjectTypeErr    -5025    Object is a file, not a directory
  2780.     
  2781.     __________
  2782.     
  2783.     See also:    CopyDirectoryAccess
  2784. */
  2785.  
  2786. /*****************************************************************************/
  2787.  
  2788. pascal    OSErr    HMoveRenameCompat(short vRefNum,
  2789.                                   long srcDirID,
  2790.                                   ConstStr255Param srcName,
  2791.                                   long dstDirID,
  2792.                                   ConstStr255Param dstpathName,
  2793.                                   ConstStr255Param copyName);
  2794. /*    ¶ Move a file or directory and optionally rename it.
  2795.     The HMoveRenameCompat function moves a file or directory and optionally
  2796.     renames it.  The source and destination locations must be on the same
  2797.     volume. This routine works even if the volume doesn't support MoveRename.
  2798.     
  2799.     vRefNum        input:    Volume specification.
  2800.     srcDirID    input:    Source directory ID.
  2801.     srcName        input:    The source object name.
  2802.     dstDirID    input:    Destination directory ID.
  2803.     dstName        input:    Pointer to destination directory name, or
  2804.                         nil when dstDirID specifies a directory.
  2805.     copyName    input:    Points to the new name if the object is to be
  2806.                         renamed or nil if the object isn't to be renamed.
  2807.     
  2808.     Result Codes
  2809.         noErr                0        No error
  2810.         dirFulErr            -33        File directory full
  2811.         dskFulErr            -34        Disk is full
  2812.         nsvErr                -35        Volume not found
  2813.         ioErr                -36        I/O error
  2814.         bdNamErr            -37        Bad filename or attempt to move into
  2815.                                     a file
  2816.         fnfErr                -43        Source file or directory not found
  2817.         wPrErr                -44        Hardware volume lock
  2818.         fLckdErr            -45        File is locked
  2819.         vLckdErr            -46        Destination volume is read-only
  2820.         fBsyErr                -47        File busy, directory not empty, or
  2821.                                     working directory control block open
  2822.         dupFNErr            -48        Destination already exists
  2823.         paramErr            -50        Volume doesn't support this function,
  2824.                                     no default volume, or source and
  2825.         volOfflinErr        -53        Volume is offline
  2826.         fsRnErr                -59        Problem during rename
  2827.         dirNFErr            -120    Directory not found or incomplete pathname
  2828.         badMovErr            -122    Attempted to move directory into
  2829.                                     offspring
  2830.         wrgVolTypErr        -123    Not an HFS volume (it's a MFS volume)
  2831.         notAFileErr            -1302    The pathname is nil, the pathname
  2832.                                     is empty, or the pathname cannot refer
  2833.                                     to a filename
  2834.         diffVolErr            -1303    Files on different volumes
  2835.         afpAccessDenied        -5000    The user does not have the right to
  2836.                                     move the file  or directory
  2837.         afpObjectTypeErr    -5025    Directory not found or incomplete pathname
  2838.         afpSameObjectErr    -5038    Source and destination files are the same
  2839.     
  2840.     __________
  2841.     
  2842.     See also:    FSpMoveRenameCompat
  2843. */
  2844.  
  2845. /*****************************************************************************/
  2846.  
  2847. pascal    OSErr    FSpMoveRenameCompat(const FSSpec *srcSpec,
  2848.                                     const FSSpec *dstSpec,
  2849.                                     ConstStr255Param copyName);
  2850. /*    ¶ Move a file or directory and optionally rename it.
  2851.     The FSpMoveRenameCompat function moves a file or directory and optionally
  2852.     renames it.  The source and destination locations must be on the same
  2853.     volume. This routine works even if the volume doesn't support MoveRename.
  2854.     
  2855.     srcSpec        input:    An FSSpec record specifying the source object.
  2856.     dstSpec        input:    An FSSpec record specifying the destination
  2857.                         directory.
  2858.     copyName    input:    Points to the new name if the object is to be
  2859.                         renamed or nil if the object isn't to be renamed.
  2860.     
  2861.     Result Codes
  2862.         noErr                0        No error
  2863.         dirFulErr            -33        File directory full
  2864.         dskFulErr            -34        Disk is full
  2865.         nsvErr                -35        Volume not found
  2866.         ioErr                -36        I/O error
  2867.         bdNamErr            -37        Bad filename or attempt to move into
  2868.                                     a file
  2869.         fnfErr                -43        Source file or directory not found
  2870.         wPrErr                -44        Hardware volume lock
  2871.         fLckdErr            -45        File is locked
  2872.         vLckdErr            -46        Destination volume is read-only
  2873.         fBsyErr                -47        File busy, directory not empty, or
  2874.                                     working directory control block open
  2875.         dupFNErr            -48        Destination already exists
  2876.         paramErr            -50        Volume doesn't support this function,
  2877.                                     no default volume, or source and
  2878.         volOfflinErr        -53        Volume is offline
  2879.         fsRnErr                -59        Problem during rename
  2880.         dirNFErr            -120    Directory not found or incomplete pathname
  2881.         badMovErr            -122    Attempted to move directory into
  2882.                                     offspring
  2883.         wrgVolTypErr        -123    Not an HFS volume (it's a MFS volume)
  2884.         notAFileErr            -1302    The pathname is nil, the pathname
  2885.                                     is empty, or the pathname cannot refer
  2886.                                     to a filename
  2887.         diffVolErr            -1303    Files on different volumes
  2888.         afpAccessDenied        -5000    The user does not have the right to
  2889.                                     move the file  or directory
  2890.         afpObjectTypeErr    -5025    Directory not found or incomplete pathname
  2891.         afpSameObjectErr    -5038    Source and destination files are the same
  2892.     
  2893.     __________
  2894.     
  2895.     See also:    HMoveRenameCompat
  2896. */
  2897.  
  2898. /*****************************************************************************/
  2899.  
  2900. pascal    OSErr    BuildAFPVolMountInfo(short flags,
  2901.                                      char nbpInterval,
  2902.                                      char nbpCount,
  2903.                                      short uamType,
  2904.                                      Str32 zoneName,
  2905.                                      Str31 serverName,
  2906.                                      Str27 volName,
  2907.                                      Str31 userName,
  2908.                                      Str8 userPassword,
  2909.                                      Str8 volPassword,
  2910.                                      AFPVolMountInfoPtr *afpInfoPtr);
  2911. /*    ¶ Allocate and initializes the fields of an AFPVolMountInfo record.
  2912.     The BuildAFPVolMountInfo function allocates and initializes the fields
  2913.     of an AFPVolMountInfo record before using that record to call
  2914.     the VolumeMount function.
  2915.     
  2916.     flags            input:    The AFP mounting flags. 0 = normal mount;
  2917.                             set bit 0 to inhibit greeting messages.
  2918.     nbpInterval        input:    The interval used for VolumeMount's
  2919.                             NBP Lookup call. 7 is a good choice.
  2920.     nbpCount        input:    The retry count used for VolumeMount's
  2921.                             NBP Lookup call. 5 is a good choice.
  2922.     uamType            input:    The user authentication method to use.
  2923.     zoneName        input:    The AppleTalk zone name of the server.
  2924.     serverName        input:    The AFP server name.
  2925.     volName            input:    The AFP volume name.
  2926.     userName        input:    The user name (zero length Pascal string for
  2927.                             guest).
  2928.     userPassWord    input:    The user password (zero length Pascal string
  2929.                             if no user password)
  2930.     volPassWord        input:    The volume password (zero length Pascal string
  2931.                             if no volume password)
  2932.     afpInfoPtr        output:    A pointer to the newly created and initialized
  2933.                             AFPVolMountInfo record. If the function fails to
  2934.                             create an AFPVolMountInfo record, it sets
  2935.                             afpInfoPtr to NULL and the function result is
  2936.                             memFullErr. Your program is responsible
  2937.                             for disposing of this pointer when it is finished
  2938.                             with it.
  2939.     
  2940.     Result Codes
  2941.         noErr                0        No error
  2942.         memFullErr            -108    memory full error
  2943.     
  2944.     __________
  2945.     
  2946.     Also see:    GetVolMountInfoSize, GetVolMountInfo, VolumeMount,
  2947.                 RetrieveAFPVolMountInfo, BuildAFPXVolMountInfo,
  2948.                 RetrieveAFPXVolMountInfo
  2949. */
  2950.  
  2951. /*****************************************************************************/
  2952.  
  2953. pascal    OSErr    RetrieveAFPVolMountInfo(AFPVolMountInfoPtr afpInfoPtr,
  2954.                                         short *flags,
  2955.                                         short *uamType,
  2956.                                         StringPtr zoneName,
  2957.                                         StringPtr serverName,
  2958.                                         StringPtr volName,
  2959.                                         StringPtr userName);
  2960. /*    ¶ Retrieve the AFP mounting information from an AFPVolMountInfo record.
  2961.     The RetrieveAFPVolMountInfo function retrieves the AFP mounting
  2962.     information returned in an AFPVolMountInfo record by the
  2963.     GetVolMountInfo function.
  2964.     
  2965.     afpInfoPtr        input:    Pointer to AFPVolMountInfo record that contains
  2966.                             the AFP mounting information.
  2967.     flags            output:    The AFP mounting flags.
  2968.     uamType            output:    The user authentication method used.
  2969.     zoneName        output:    The AppleTalk zone name of the server.
  2970.     serverName        output:    The AFP server name.
  2971.     volName            output:    The AFP volume name.
  2972.     userName        output:    The user name (zero length Pascal string for
  2973.                             guest).
  2974.     
  2975.     Result Codes
  2976.         noErr                0        No error
  2977.         paramErr            -50        media field in AFP mounting information
  2978.                                     was not AppleShareMediaType
  2979.     
  2980.     __________
  2981.     
  2982.     Also see:    GetVolMountInfoSize, GetVolMountInfo, VolumeMount,
  2983.                 BuildAFPVolMountInfo, BuildAFPXVolMountInfo,
  2984.                 RetrieveAFPXVolMountInfo
  2985. */
  2986.  
  2987. /*****************************************************************************/
  2988.  
  2989. pascal    OSErr    BuildAFPXVolMountInfo(short flags,
  2990.                                       char nbpInterval,
  2991.                                       char nbpCount,
  2992.                                       short uamType,
  2993.                                       Str32 zoneName,
  2994.                                       Str31 serverName,
  2995.                                       Str27 volName,
  2996.                                       Str31 userName,
  2997.                                       Str8 userPassword,
  2998.                                       Str8 volPassword,
  2999.                                       Str32 uamName,
  3000.                                       unsigned long alternateAddressLength,
  3001.                                       void *alternateAddress,
  3002.                                       AFPXVolMountInfoPtr *afpXInfoPtr);
  3003. /*    ¶ Allocate and initializes the fields of an AFPXVolMountInfo record.
  3004.     The BuildAFPXVolMountInfo function allocates and initializes the fields
  3005.     of an AFPXVolMountInfo record before using that record to call
  3006.     the VolumeMount function.
  3007.     
  3008.     flags                    input:    The AFP mounting flags.
  3009.     nbpInterval                input:    The interval used for VolumeMount's
  3010.                                     NBP Lookup call. 7 is a good choice.
  3011.     nbpCount                input:    The retry count used for VolumeMount's
  3012.                                     NBP Lookup call. 5 is a good choice.
  3013.     uamType                    input:    The user authentication method to use.
  3014.     zoneName                input:    The AppleTalk zone name of the server.
  3015.     serverName                input:    The AFP server name.
  3016.     volName                    input:    The AFP volume name.
  3017.     userName                input:    The user name (zero length Pascal string
  3018.                                     for guest).
  3019.     userPassWord            input:    The user password (zero length Pascal
  3020.                                     string if no user password)
  3021.     volPassWord                input:    The volume password (zero length Pascal
  3022.                                     string if no volume password)
  3023.     uamName                    input:    The User Authentication Method name.
  3024.     alternateAddressLength    input:    Length of alternateAddress data.
  3025.     alternateAddress        input    The AFPAlternateAddress (variable length)
  3026.     afpXInfoPtr                output:    A pointer to the newly created and
  3027.                                     initialized AFPVolMountInfo record.
  3028.                                     If the function fails to create an
  3029.                                     AFPVolMountInfo record, it sets
  3030.                                     afpInfoPtr to NULL and the function
  3031.                                     result is memFullErr. Your program is
  3032.                                     responsible for disposing of this pointer
  3033.                                     when it is finished with it.
  3034.     
  3035.     Result Codes
  3036.         noErr                0        No error
  3037.         memFullErr            -108    memory full error
  3038.     
  3039.     __________
  3040.     
  3041.     Also see:    GetVolMountInfoSize, GetVolMountInfo, VolumeMount,
  3042.                 BuildAFPVolMountInfo, RetrieveAFPVolMountInfo,
  3043.                 RetrieveAFPXVolMountInfo
  3044. */
  3045.  
  3046. /*****************************************************************************/
  3047.  
  3048. pascal    OSErr    RetrieveAFPXVolMountInfo(AFPXVolMountInfoPtr afpXInfoPtr,
  3049.                                          short *flags,
  3050.                                          short *uamType,
  3051.                                          StringPtr zoneName,
  3052.                                          StringPtr serverName,
  3053.                                          StringPtr volName,
  3054.                                          StringPtr userName,
  3055.                                          StringPtr uamName,
  3056.                                          unsigned long *alternateAddressLength,
  3057.                                          AFPAlternateAddress **alternateAddress);
  3058. /*    ¶ Retrieve the AFP mounting information from an AFPXVolMountInfo record.
  3059.     The RetrieveAFPXVolMountInfo function retrieves the AFP mounting
  3060.     information returned in an AFPXVolMountInfo record by the
  3061.     GetVolMountInfo function.
  3062.     
  3063.     afpXInfoPtr                input:    Pointer to AFPXVolMountInfo record that
  3064.                                     contains the AFP mounting information.
  3065.     flags                    output:    The AFP mounting flags.
  3066.     uamType                    output:    The user authentication method used.
  3067.     zoneName                output:    The AppleTalk zone name of the server.
  3068.     serverName                output:    The AFP server name.
  3069.     volName                    output:    The AFP volume name.
  3070.     userName                output:    The user name (zero length Pascal
  3071.                                     string for guest).
  3072.     uamName                    output:    The User Authentication Method name.
  3073.     alternateAddressLength    output:    Length of alternateAddress data returned.
  3074.     alternateAddress:        output:    A pointer to the newly created and
  3075.                                     AFPAlternateAddress record (a variable
  3076.                                     length record). If the function fails to
  3077.                                     create an AFPAlternateAddress record,
  3078.                                     it sets alternateAddress to NULL and the
  3079.                                     function result is memFullErr. Your
  3080.                                     program is responsible for disposing of
  3081.                                     this pointer when it is finished with it.
  3082.     
  3083.     Result Codes
  3084.         noErr                0        No error
  3085.         paramErr            -50        media field in AFP mounting information
  3086.                                     was not AppleShareMediaType
  3087.         memFullErr            -108    memory full error
  3088.     
  3089.     __________
  3090.     
  3091.     Also see:    GetVolMountInfoSize, GetVolMountInfo, VolumeMount,
  3092.                 BuildAFPVolMountInfo, RetrieveAFXVolMountInfo,
  3093.                 BuildAFPXVolMountInfo
  3094. */
  3095.  
  3096. /*****************************************************************************/
  3097.  
  3098. pascal    OSErr    GetUGEntries(short objType,
  3099.                              UGEntryPtr entries,
  3100.                              long reqEntryCount,
  3101.                              long *actEntryCount,
  3102.                              long *objID);
  3103. /*    ¶ Retrieve a list of user or group entries from the local file server.
  3104.     The GetUGEntries functions retrieves a list of user or group entries
  3105.     from the local file server.
  3106.  
  3107.     objType            input:    The object type: -1 = group; 0 = user
  3108.     UGEntries        input:    Pointer to array of UGEntry records where the list
  3109.                             is returned.
  3110.     reqEntryCount    input:    The number of elements in the UGEntries array.
  3111.     actEntryCount    output:    The number of entries returned.
  3112.     objID            input:    The current index position. Set to 0 to start with
  3113.                             the first entry.
  3114.                     output:    The index position to get the next entry. Pass this
  3115.                             value the next time you call GetUGEntries to start
  3116.                             where you left off.
  3117.     
  3118.     Result Codes
  3119.         noErr                0        No error    
  3120.         fnfErr                -43        No more users or groups    
  3121.         paramErr            -50        Function not supported; or, ioObjID is
  3122.                                     negative    
  3123.  
  3124.     __________
  3125.     
  3126.     Also see:    GetUGEntry
  3127. */
  3128.  
  3129. /*****************************************************************************/
  3130.  
  3131. #ifdef __cplusplus
  3132. }
  3133. #endif
  3134.  
  3135. #include "OptimizationEnd.h"
  3136.  
  3137. #endif    /* __MOREFILESEXTRAS__ */
  3138.